[~] Change reboot principle
This commit is contained in:
parent
20e34dd255
commit
a46b6c936a
@ -331,19 +331,22 @@ class VMKer:
|
|||||||
# TODO: yml
|
# TODO: yml
|
||||||
logger.info(f"[{_name}] [YML] Executing %.yml")
|
logger.info(f"[{_name}] [YML] Executing %.yml")
|
||||||
|
|
||||||
logger.info(f"[{_name}] Rebooting")
|
|
||||||
ssh.send_command_timing('reboot')
|
|
||||||
ssh.disconnect()
|
ssh.disconnect()
|
||||||
|
vm.RebootGuest()
|
||||||
|
logger.info(f"[{_name}] Rebooting")
|
||||||
|
|
||||||
end_time = time.time() + timeout
|
time.sleep(5)
|
||||||
|
end_time = time.time() + timeout - 5
|
||||||
while time.time() < end_time:
|
while time.time() < end_time:
|
||||||
try:
|
try:
|
||||||
ssh = ConnectHandler(**_ssh_connect)
|
ssh = ConnectHandler(**_ssh_connect)
|
||||||
|
break
|
||||||
except Exception:
|
except Exception:
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
if not ssh.is_alive():
|
if not ssh.is_alive():
|
||||||
return logger.error(f"[{_name}] Host startup TimeOut.")
|
return logger.error(f"[{_name}] Host startup TimeOut.")
|
||||||
|
|
||||||
|
logger.success(f"[{_name}] [SSH] Connected to {ipv4[0]} as {user}")
|
||||||
logger.debug(f'[{_name}] uname {ssh.send_command("uname -a")}')
|
logger.debug(f'[{_name}] uname {ssh.send_command("uname -a")}')
|
||||||
logger.info(f"[{_name}] [YML] Checks %.yml")
|
logger.info(f"[{_name}] [YML] Checks %.yml")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user