From 7a6136ed14a14e8eb9f69abb7d4034d5fc555bae Mon Sep 17 00:00:00 2001 From: Jeremy Date: Wed, 4 Mar 2015 18:24:15 -0700 Subject: [PATCH] Fixes adapter bug with VirtualBox. --- gns3server/handlers/api/virtualbox_handler.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gns3server/handlers/api/virtualbox_handler.py b/gns3server/handlers/api/virtualbox_handler.py index 93d6a039..441ab6df 100644 --- a/gns3server/handlers/api/virtualbox_handler.py +++ b/gns3server/handlers/api/virtualbox_handler.py @@ -124,17 +124,17 @@ class VirtualBoxHandler: if "enable_remote_console" in request.json: yield from vm.set_enable_remote_console(request.json.pop("enable_remote_console")) + if "adapters" in request.json: + adapters = int(request.json.pop("adapters")) + if adapters != vm.adapters: + yield from vm.set_adapters(adapters) + for name, value in request.json.items(): if hasattr(vm, name) and getattr(vm, name) != value: setattr(vm, name, value) if name == "vmname": yield from vm.rename_in_virtualbox() - if "adapters" in request.json: - adapters = int(request.json["adapters"]) - if adapters != vm.adapters: - yield from vm.set_adapters(adapters) - response.json(vm) @classmethod