Commit 1eb463f1 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

Added slapupdate to cron and fix little problems

parent 9590b07b
...@@ -119,6 +119,8 @@ SHELL=/bin/sh ...@@ -119,6 +119,8 @@ SHELL=/bin/sh
PATH=/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/bin PATH=/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/bin
MAILTO=root MAILTO=root
0 0 * * * root /usr/local/bin/slapupdate -v >> /opt/slapos/slapupdate.log 2>&1
"""> /etc/cron.d/slapos """> /etc/cron.d/slapos
if [ -f ${SLAPOS_CONFIGURATION}/SlapContainer-needed ]; then if [ -f ${SLAPOS_CONFIGURATION}/SlapContainer-needed ]; then
......
...@@ -171,12 +171,12 @@ def repositories_add (url,alias): ...@@ -171,12 +171,12 @@ def repositories_add (url,alias):
def update_software (): def update_software ():
""" Upgrade softwares """ """ Upgrade softwares """
_call(['zypper','--gpg-auto-import-keys','up','-l'] _call(['zypper','--gpg-auto-import-keys','up','-ly']
, stdout=None) , stdout=None)
def update_system (): def update_system ():
""" Dist-Upgrade of system """ """ Dist-Upgrade of system """
_call(['zypper','--gpg-auto-import-keys','dup','-l'], stdout = None) _call(['zypper','--gpg-auto-import-keys','dup','-ly'], stdout = None)
def download_info_from_networkcache(path,slapos_conf): def download_info_from_networkcache(path,slapos_conf):
...@@ -215,6 +215,7 @@ def get_info_from_master(config): ...@@ -215,6 +215,7 @@ def get_info_from_master(config):
info, path = tempfile.mkstemp() info, path = tempfile.mkstemp()
if not download_info_from_networkcache( if not download_info_from_networkcache(
path, config.slapos_configuration) == False: path, config.slapos_configuration) == False:
print open(path,'r').read()
return path return path
else : else :
raise ValueError("No result from shacache") raise ValueError("No result from shacache")
...@@ -273,7 +274,6 @@ def update_machine(config): ...@@ -273,7 +274,6 @@ def update_machine(config):
else : else :
logger.info("We will now upgrade your packages") logger.info("We will now upgrade your packages")
update_software() update_software()
os.system('reboot')
else: else:
if config.last_upgrade < config.upgrade : if config.last_upgrade < config.upgrade :
# Purge repositories list and add new ones # Purge repositories list and add new ones
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment