Skip to content
Snippets Groups Projects
Commit ba802bcc authored by Nico's avatar Nico
Browse files

remove unused code

parent c43cdf5e
No related branches found
No related tags found
No related merge requests found
......@@ -105,39 +105,6 @@ def create_snapshot_context():
restore_snapshot(snap_name)
delete_snapshot(snap_name)
def wait_for_unavailable():
"Rebooting system"
logging.debug("Waiting for VM to become unavailable...")
for i in range(90):
result = subprocess.run(["qm", "guest", "cmd", args.vmid, "ping"])
if result.returncode == 0:
logging.debug("Try {}: VM available".format(i))
else:
logging.debug("VM has become unavailable after {} tries".format(i))
return True
time.sleep(1)
logging.warning("Timeout waiting for VM to become unavailable")
return False
def wait_for_available():
logging.debug("Waiting for VM to become available...")
for i in range(90):
result = subprocess.run(["qm", "guest", "cmd", args.vmid, "ping"])
if result.returncode != 0:
logging.debug("Try {}: VM unavailable".format(i))
else:
logging.debug("VM has become available after {} tries".format(i))
return True
time.sleep(1)
logging.warning("Timeout waiting for VM to become available")
return False
def wait_for_reboot():
if wait_for_unavailable() and wait_for_available():
return True
logging.warning("Timeout waiting for VM reboot")
return False
def run_autoupdate():
logging.debug("Forcing autoupdate")
terminal = spawn_console()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment