misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
Simone Margaritelli 2019-10-20 20:59:59 +02:00
parent 74a75f03b8
commit 132666935a
No known key found for this signature in database
GPG Key ID: 82E42E7F3B34C97E

View File

@ -114,19 +114,17 @@ def install(display, update):
logging.warning("[update] can't find path for %s" % name)
return False
logging.info("[update] stopping %s ..." % update['service'])
os.system("service %s stop" % update['service'])
os.system("mv %s %s" % (source_path, dest_path))
logging.info("[update] restarting %s ..." % update['service'])
os.system("service %s start" % update['service'])
else:
if not os.path.exists(source_path):
source_path = "%s-%s" % (source_path, update['available'])
os.system("service %s stop" % update['service'])
os.system("cd %s && pip3 install ." % source_path)
logging.info("[update] restarting %s ..." % update['service'])
os.system("service %s start" % update['service'])
return True