diff --git a/yunohost_tools.py b/yunohost_tools.py index e9a695ea..36116de5 100644 --- a/yunohost_tools.py +++ b/yunohost_tools.py @@ -293,14 +293,17 @@ def tools_upgrade(): Upgrade distribution """ - if os.path.isfile('/tmp/yunohost/update_status'): - os.system('at now -f /etc/yunohost/upgrade') - with open('/tmp/yunohost/upgrade_status', 'r') as f: - read_data = f.read() - os.system('rm /tmp/yunohost/upgrade_status') - if read_data.strip() == "OK": - win_msg( _("YunoHost has been successfully upgraded")) - else: - raise YunoHostError(17, _("Error during upgrade")) + if os.path.isfile('/tmp/yunohost/upgrade.run'): + win_msg( _("Upgrade in progress")) else: - raise YunoHostError(17, _("Launch update before upgrade")) + if os.path.isfile('/tmp/yunohost/update_status'): + os.system('at now -f /etc/yunohost/upgrade') + with open('/tmp/yunohost/upgrade_status', 'r') as f: + read_data = f.read() + os.system('rm /tmp/yunohost/upgrade_status') + if read_data.strip() == "OK": + win_msg( _("YunoHost has been successfully upgraded")) + else: + raise YunoHostError(17, _("Error during upgrade")) + else: + raise YunoHostError(17, _("Launch update before upgrade"))