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
706880f03c
commit
c84406583e
1 changed files with 9 additions and 4 deletions
|
@ -276,23 +276,28 @@ def tools_update():
|
|||
else:
|
||||
return { "Update" : stdout.splitlines() }
|
||||
|
||||
|
||||
def tools_changelog():
|
||||
"""
|
||||
Show Changelog
|
||||
|
||||
"""
|
||||
with open('/tmp/changelog', 'r') as f:
|
||||
with open('/tmp/yunohost/changelog', 'r') as f:
|
||||
read_data = f.read()
|
||||
return { "Changelog" : read_data.splitlines() }
|
||||
|
||||
|
||||
def tools_upgrade():
|
||||
"""
|
||||
Upgrade distribution
|
||||
|
||||
"""
|
||||
if os.path.isfile('/tmp/update_status'):
|
||||
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"))
|
||||
|
|
Loading…
Reference in a new issue