fixing get inconsistency and adding vm_state_command

This commit is contained in:
2021-02-16 21:13:51 -06:00
parent 2e265703bd
commit e8348052a8
6 changed files with 87 additions and 14 deletions

View File

@ -30,11 +30,11 @@ def makeCapsulId():
def double_check_capsul_address(id, ipv4, get_ssh_host_keys):
try:
result = current_app.config["HUB_MODEL"].get(id, get_ssh_host_keys)
if result != None and result.ipv4 != ipv4:
if result != None and result.ipv4 != None and result.ipv4 != ipv4:
ipv4 = result.ipv4
get_model().update_vm_ip(email=session["account"], id=id, ipv4=result.ipv4)
if result != None and get_ssh_host_keys:
if result != None and result.ipv4 != None and get_ssh_host_keys:
get_model().update_vm_ssh_host_keys(email=session["account"], id=id, ssh_host_keys=result.ssh_host_keys)
except:
current_app.logger.error(f"""