mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Update yunohost_tools.py
This commit is contained in:
parent
a2e02c56cf
commit
8fbfb57ffb
1 changed files with 6 additions and 2 deletions
|
@ -275,6 +275,7 @@ def tools_update():
|
||||||
raise YunoHostError(17, _("Error during update"))
|
raise YunoHostError(17, _("Error during update"))
|
||||||
else:
|
else:
|
||||||
return { "Update" : stdout.splitlines() }
|
return { "Update" : stdout.splitlines() }
|
||||||
|
|
||||||
|
|
||||||
def tools_changelog():
|
def tools_changelog():
|
||||||
"""
|
"""
|
||||||
|
@ -287,6 +288,7 @@ def tools_changelog():
|
||||||
return { "Changelog" : read_data.splitlines() }
|
return { "Changelog" : read_data.splitlines() }
|
||||||
else:
|
else:
|
||||||
raise YunoHostError(17, _("Launch update before upgrade"))
|
raise YunoHostError(17, _("Launch update before upgrade"))
|
||||||
|
|
||||||
|
|
||||||
def tools_upgrade():
|
def tools_upgrade():
|
||||||
"""
|
"""
|
||||||
|
@ -296,8 +298,7 @@ def tools_upgrade():
|
||||||
if os.path.isfile('/tmp/yunohost/upgrade.run'):
|
if os.path.isfile('/tmp/yunohost/upgrade.run'):
|
||||||
win_msg( _("Upgrade in progress"))
|
win_msg( _("Upgrade in progress"))
|
||||||
else:
|
else:
|
||||||
if os.path.isfile('/tmp/yunohost/update_status'):
|
if os.path.isfile('/tmp/yunohost/upgrade_status'):
|
||||||
os.system('at now -f /etc/yunohost/upgrade')
|
|
||||||
with open('/tmp/yunohost/upgrade_status', 'r') as f:
|
with open('/tmp/yunohost/upgrade_status', 'r') as f:
|
||||||
read_data = f.read()
|
read_data = f.read()
|
||||||
os.system('rm /tmp/yunohost/upgrade_status')
|
os.system('rm /tmp/yunohost/upgrade_status')
|
||||||
|
@ -305,5 +306,8 @@ def tools_upgrade():
|
||||||
win_msg( _("YunoHost has been successfully upgraded"))
|
win_msg( _("YunoHost has been successfully upgraded"))
|
||||||
else:
|
else:
|
||||||
raise YunoHostError(17, _("Error during upgrade"))
|
raise YunoHostError(17, _("Error during upgrade"))
|
||||||
|
elif os.path.isfile('/tmp/yunohost/update_status'):
|
||||||
|
os.system('at now -f /etc/yunohost/upgrade')
|
||||||
|
win_msg( _("Upgrade in progress"))
|
||||||
else:
|
else:
|
||||||
raise YunoHostError(17, _("Launch update before upgrade"))
|
raise YunoHostError(17, _("Launch update before upgrade"))
|
||||||
|
|
Loading…
Reference in a new issue