Fix switching console type from telnet to VNC throws error. Fixes #2489.

This commit is contained in:
grossmj committed 2018-06-09 21:47:36 +07:00
1 parent 1905a99ce7
commit 40151cd1fe
5 files changed
+9 -4

No files matched your search

@@ -120,7 +120,8 @@ class QEMUHandler:
qemu_manager = Qemu.instance()
vm = qemu_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
# update the console first to avoid issue if updating console type
vm.console = request.json.pop("console", vm.console)
for name, value in request.json.items():
if hasattr(vm, name) and getattr(vm, name) != value:
setattr(vm, name, value)
@@ -138,6 +138,9 @@ class VirtualBoxHandler:
if ram != vm.ram:
yield from vm.set_ram(ram)
# update the console first to avoid issue if updating console type
vm.console = request.json.pop("console", vm.console)
for name, value in request.json.items():
if hasattr(vm, name) and getattr(vm, name) != value:
setattr(vm, name, value)
@@ -106,7 +106,8 @@ class VMwareHandler:
vmware_manager = VMware.instance()
vm = vmware_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
# update the console first to avoid issue if updating console type
vm.console = request.json.pop("console", vm.console)
for name, value in request.json.items():
if hasattr(vm, name) and getattr(vm, name) != value:
setattr(vm, name, value)