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
1fdc5e2d15
commit
292000ec54
1 changed files with 33 additions and 0 deletions
|
@ -262,3 +262,36 @@ def tools_postinstall(domain, password, dyndns=False):
|
|||
win_msg(_("YunoHost has been successfully configured"))
|
||||
|
||||
|
||||
def tools_update():
|
||||
"""
|
||||
Update distribution
|
||||
|
||||
"""
|
||||
|
||||
process = Popen("/usr/local/bin/checkupdate", stdout=PIPE)
|
||||
stdout, stderr = process.communicate()
|
||||
if process.returncode == 1:
|
||||
win_msg( _("Not upgrade found"))
|
||||
elif process.returncode == 2:
|
||||
raise YunoHostError(17, _("Error during update"))
|
||||
else:
|
||||
return { "Update" : stdout.splitlines() }
|
||||
|
||||
def tools_changelog():
|
||||
"""
|
||||
Show Changelog
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
||||
def tools_upgrade():
|
||||
"""
|
||||
Upgrade distribution
|
||||
|
||||
"""
|
||||
|
||||
if os.path.isfile('/tmp/update_status'):
|
||||
os.system('at now -f /etc/yunohost/upgrade')
|
||||
else:
|
||||
raise YunoHostError(17, _("Launch update before upgrade"))
|
||||
|
|
Loading…
Reference in a new issue