setup: Clarify success log message when force upgrading

Currently, in cases of ignoring an upgrade and actually upgrading, the log
message says success which is somewhat confusing. Make the force_upgrade()
methods in apps return information about ignoring the upgrade and print log
message accordingly.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2019-08-10 09:38:49 -04:00
1 parent ecc28a72bd
commit acdcabcbed
4 files changed
+12 -6

No files matched your search

+5 -2
View File
@@ -508,8 +508,11 @@ class ForceUpgrader():
for app, packages in apps.items():
try:
logger.info('Force upgrading app: %s', app.name)
app.force_upgrade(app.setup_helper, packages)
logger.info('Successfully force upgraded app: %s', app.name)
if app.force_upgrade(app.setup_helper, packages):
logger.info('Successfully force upgraded app: %s',
app.name)
else:
logger.info('Ignored force upgrade for app: %s', app.name)
except Exception as exception:
logger.exception('Error running force upgrade: %s', exception)
need_retry = True