Attempt upgrade from UI 2x if it fails once - smooths over failures if upgrade script changes

This commit is contained in:
Taylor Helsper 2021-04-29 20:56:17 -05:00
parent 8d3c24981d
commit 97d96efd09

View File

@ -165,7 +165,10 @@ def upgrade_device():
file1 = "/home/admin/upgrade_logs/upgrade_log_from_{}_upgrade.txt".format(get_current_version())
file2 = "/home/admin/upgrade_logs/upgrade_log_latest.txt"
cmd = "/usr/bin/mynode_upgrade.sh 2>&1 | tee {} {}".format(file1, file2)
subprocess.call(cmd, shell=True)
ret = subprocess.call(cmd, shell=True)
if ret != 0:
# Try one more time....
subprocess.call(cmd, shell=True)
# Sync
os.system("sync")
@ -183,7 +186,10 @@ def upgrade_device_beta():
file1 = "/home/admin/upgrade_logs/upgrade_log_from_{}_upgrade.txt".format(get_current_version())
file2 = "/home/admin/upgrade_logs/upgrade_log_latest.txt"
cmd = "/usr/bin/mynode_upgrade.sh beta 2>&1 | tee {} {}".format(file1, file2)
subprocess.call(cmd, shell=True)
ret = subprocess.call(cmd, shell=True)
if ret != 0:
# Try one more time....
subprocess.call(cmd, shell=True)
# Sync
os.system("sync")