Update yunohost_tools.py

This commit is contained in:
abeudin 2014-03-13 12:22:54 +01:00
parent 524489edaa
commit 6a9a8f082d

View file

@ -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"))