Object of type dict_keys is not JSON serializable
This commit is contained in:
parent
37babae903
commit
1cdd918e28
@ -72,7 +72,7 @@ def index():
|
|||||||
try:
|
try:
|
||||||
if request.form['desired_state'] == "running":
|
if request.form['desired_state'] == "running":
|
||||||
if 'macs' in virt_vm and len(virt_vm['macs'].keys()) > 0:
|
if 'macs' in virt_vm and len(virt_vm['macs'].keys()) > 0:
|
||||||
current_app.config["HUB_MODEL"].net_set_dhcp(email=session['account'], host_id=virt_vm['host'], network_name=virt_vm['network_name'], macs=virt_vm['macs'].keys(), add_ipv4=db_vm['public_ipv4'])
|
current_app.config["HUB_MODEL"].net_set_dhcp(email=session['account'], host_id=virt_vm['host'], network_name=virt_vm['network_name'], macs=list(virt_vm['macs'].keys()), add_ipv4=db_vm['public_ipv4'])
|
||||||
|
|
||||||
current_app.config["HUB_MODEL"].vm_state_command(email=session['account'], id=id, command="start")
|
current_app.config["HUB_MODEL"].vm_state_command(email=session['account'], id=id, command="start")
|
||||||
elif request.form['desired_state'] == "shut off":
|
elif request.form['desired_state'] == "shut off":
|
||||||
@ -97,7 +97,7 @@ def index():
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
current_app.config["HUB_MODEL"].vm_state_command(email=session['account'], id=id, command="force-stop")
|
current_app.config["HUB_MODEL"].vm_state_command(email=session['account'], id=id, command="force-stop")
|
||||||
current_app.config["HUB_MODEL"].net_set_dhcp(email=session['account'], host_id=virt_vm['host'], network_name=virt_vm['network_name'], macs=virt_vm['macs'].keys(), remove_ipv4=virt_vm['public_ipv4'], add_ipv4=db_vm['public_ipv4'])
|
current_app.config["HUB_MODEL"].net_set_dhcp(email=session['account'], host_id=virt_vm['host'], network_name=virt_vm['network_name'], macs=list(virt_vm['macs'].keys()), remove_ipv4=virt_vm['public_ipv4'], add_ipv4=db_vm['public_ipv4'])
|
||||||
current_app.config["HUB_MODEL"].vm_state_command(email=session['account'], id=id, command="start")
|
current_app.config["HUB_MODEL"].vm_state_command(email=session['account'], id=id, command="start")
|
||||||
except:
|
except:
|
||||||
flash(f"""error during dhcp_reset of {id}: {my_exec_info_message(sys.exc_info())}""")
|
flash(f"""error during dhcp_reset of {id}: {my_exec_info_message(sys.exc_info())}""")
|
||||||
@ -116,7 +116,7 @@ def index():
|
|||||||
#db_vm = db_vms_by_id[id]
|
#db_vm = db_vms_by_id[id]
|
||||||
|
|
||||||
current_app.config["HUB_MODEL"].vm_state_command(email=session['account'], id=id, command="force-stop")
|
current_app.config["HUB_MODEL"].vm_state_command(email=session['account'], id=id, command="force-stop")
|
||||||
current_app.config["HUB_MODEL"].net_set_dhcp(email=session['account'], host_id=virt_vm['host'], network_name=virt_vm['network_name'], macs=virt_vm['macs'].keys(), remove_ipv4=virt_vm['public_ipv4'])
|
current_app.config["HUB_MODEL"].net_set_dhcp(email=session['account'], host_id=virt_vm['host'], network_name=virt_vm['network_name'], macs=list(virt_vm['macs'].keys()), remove_ipv4=virt_vm['public_ipv4'])
|
||||||
|
|
||||||
return redirect(f"{url_for('admin.index')}")
|
return redirect(f"{url_for('admin.index')}")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user