From 875c570c6dbcf406025478054ba09e98b6e09e81 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 16 Sep 2019 00:13:41 +0200 Subject: [PATCH] Check if the upgrade got manually interrupted, c.f. same stuff in app_install --- locales/en.json | 1 + src/yunohost/app.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/locales/en.json b/locales/en.json index cc7955204..d584d80d9 100644 --- a/locales/en.json +++ b/locales/en.json @@ -409,6 +409,7 @@ "no_ipv6_connectivity": "IPv6 connectivity is not available", "no_restore_script": "No restore script found for the app '{app:s}'", "not_enough_disk_space": "Not enough free disk space on '{path:s}'", + "operation_interrupted": "The operation was manually interrupted?", "package_not_installed": "Package '{pkgname}' is not installed", "package_unexpected_error": "An unexpected error occurred processing the package '{pkgname}'", "package_unknown": "Unknown package '{pkgname}'", diff --git a/src/yunohost/app.py b/src/yunohost/app.py index 0784f1ecc..41c3faed6 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -679,7 +679,10 @@ def app_upgrade(app=[], url=None, file=None): finally: # Did the script succeed ? - if upgrade_retcode != 0: + if upgrade_retcode == -1: + error_msg = m18n.n('operation_interrupted') + operation_logger.error(error_msg) + elif upgrade_retcode != 0: error_msg = m18n.n('app_upgrade_failed', app=app_instance_name) operation_logger.error(error_msg)