create capsul is working

This commit is contained in:
2021-01-04 15:02:56 -06:00
parent 44e918a974
commit 4833c6250b
6 changed files with 95 additions and 55 deletions

View File

@ -27,16 +27,20 @@ def makeCapsulId():
return f"capsul-{lettersAndNumbers}"
def double_check_capsul_address(id, ipv4):
try:
result = current_app.config["HUB_MODEL"].get(id)
if result.ipv4 != ipv4:
ipv4 = result.ipv4
get_model().update_vm_ip(email=session["account"], id=id, ipv4=result.ipv4)
except:
current_app.logger.error(f"""
the virtualization model threw an error in double_check_capsul_address of {id}:
{my_exec_info_message(sys.exc_info())}"""
)
result = current_app.config["HUB_MODEL"].get(id)
if result.ipv4 != ipv4:
ipv4 = result.ipv4
get_model().update_vm_ip(email=session["account"], id=id, ipv4=result.ipv4)
# try:
# result = current_app.config["HUB_MODEL"].get(id)
# if result.ipv4 != ipv4:
# ipv4 = result.ipv4
# get_model().update_vm_ip(email=session["account"], id=id, ipv4=result.ipv4)
# except:
# current_app.logger.error(f"""
# the virtualization model threw an error in double_check_capsul_address of {id}:
# {my_exec_info_message(sys.exc_info())}"""
# )
return ipv4