first try at implementing the vm start and stop feature

This commit is contained in:
2021-02-17 20:50:17 -06:00
parent e8348052a8
commit ba0b29462c
9 changed files with 296 additions and 159 deletions

View File

@ -144,8 +144,8 @@ class CapsulFlaskHub(VirtualizationInterface):
for result in results:
try:
result_body = json.loads(result.body)
if isinstance(result_body, dict) and ('ipv4' in result_body or 'ipv6' in result_body):
return VirtualMachine(id, host=host, ipv4=result_body['ipv4'], ipv6=result_body['ipv6'], ssh_host_keys=result_body['ssh_host_keys'])
if isinstance(result_body, dict) and ('state' in result_body):
return VirtualMachine(id, host=host, state=result_body['state'], ipv4=result_body['ipv4'], ipv6=result_body['ipv6'], ssh_host_keys=result_body['ssh_host_keys'])
except:
pass