From af942dc41972e2c76bbeed5d501cc978f32cbfd0 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Tue, 14 Apr 2015 14:24:13 +0200 Subject: [PATCH] Fix a crash in VirtualBox vm creation Fix #138 --- gns3server/handlers/api/virtualbox_handler.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gns3server/handlers/api/virtualbox_handler.py b/gns3server/handlers/api/virtualbox_handler.py index f0765180..008ac2e6 100644 --- a/gns3server/handlers/api/virtualbox_handler.py +++ b/gns3server/handlers/api/virtualbox_handler.py @@ -79,8 +79,9 @@ class VirtualBoxHandler: yield from vm.set_ram(ram) for name, value in request.json.items(): - if hasattr(vm, name) and getattr(vm, name) != value: - setattr(vm, name, value) + if name != "vm_id": + if hasattr(vm, name) and getattr(vm, name) != value: + setattr(vm, name, value) response.set_status(201) response.json(vm)