Improve messages when app upgrades start

This commit is contained in:
Alexandre Aubin 2019-02-16 14:37:36 +01:00
parent 2d3ff79683
commit 562b3b98f6
2 changed files with 6 additions and 2 deletions

View file

@ -36,7 +36,8 @@
"app_sources_fetch_failed": "Unable to fetch sources files",
"app_unknown": "Unknown app",
"app_unsupported_remote_type": "Unsupported remote type used for the app",
"app_upgrade_app_name": "Upgrading app {app}…",
"app_upgrade_several_apps": "The following apps will be upgraded : {apps}",
"app_upgrade_app_name": "Now upgrading app {app}…",
"app_upgrade_failed": "Unable to upgrade {app:s}",
"app_upgrade_some_app_failed": "Unable to upgrade some applications",
"app_upgraded": "{app:s} has been upgraded",

View file

@ -586,7 +586,10 @@ def app_upgrade(auth, app=[], url=None, file=None):
elif not isinstance(app, list):
apps = [app]
logger.info("Upgrading apps %s", ", ".join(app))
if len(apps) == 0:
raise YunohostError('app_no_upgrade')
if len(apps) > 1:
logger.info(m18n.n("app_upgrade_several_apps", apps=", ".join(app)))
for app_instance_name in apps:
logger.info(m18n.n('app_upgrade_app_name', app=app_instance_name))