From fd0e8f89db7da14c298c3316f20d2484eab9452d Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Tue, 12 Jul 2016 16:29:58 +0200 Subject: [PATCH] Fix VMware support --- gns3server/compute/vmware/vmware_vm.py | 3 +- .../handlers/api/compute/vmware_handler.py | 3 +- gns3server/schemas/vmware.py | 59 ++----------------- 3 files changed, 8 insertions(+), 57 deletions(-) diff --git a/gns3server/compute/vmware/vmware_vm.py b/gns3server/compute/vmware/vmware_vm.py index d84e4fc6..b033216d 100644 --- a/gns3server/compute/vmware/vmware_vm.py +++ b/gns3server/compute/vmware/vmware_vm.py @@ -88,7 +88,8 @@ class VMwareVM(BaseNode): "adapter_type": self.adapter_type, "use_any_adapter": self.use_any_adapter, "status": self.status, - "node_directory": self.working_dir} + "node_directory": self.working_dir, + "linked_clone": self._linked_clone} return json @property diff --git a/gns3server/handlers/api/compute/vmware_handler.py b/gns3server/handlers/api/compute/vmware_handler.py index 91e1c698..2fb80be8 100644 --- a/gns3server/handlers/api/compute/vmware_handler.py +++ b/gns3server/handlers/api/compute/vmware_handler.py @@ -26,7 +26,6 @@ from gns3server.compute.project_manager import ProjectManager from gns3server.schemas.vmware import ( VMWARE_CREATE_SCHEMA, - VMWARE_UPDATE_SCHEMA, VMWARE_OBJECT_SCHEMA ) @@ -100,7 +99,7 @@ class VMwareHandler: 409: "Conflict" }, description="Update a VMware VM instance", - input=VMWARE_UPDATE_SCHEMA, + input=VMWARE_OBJECT_SCHEMA, output=VMWARE_OBJECT_SCHEMA) def update(request, response): diff --git a/gns3server/schemas/vmware.py b/gns3server/schemas/vmware.py index 4bbcc6d5..2b795fd8 100644 --- a/gns3server/schemas/vmware.py +++ b/gns3server/schemas/vmware.py @@ -80,58 +80,6 @@ VMWARE_CREATE_SCHEMA = { "required": ["name", "vmx_path", "linked_clone"], } -VMWARE_UPDATE_SCHEMA = { - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Request validation to update a VMware VM instance", - "type": "object", - "properties": { - "name": { - "description": "VMware VM instance name", - "type": "string", - "minLength": 1, - }, - "vmx_path": { - "description": "Path to the vmx file", - "type": "string", - "minLength": 1, - }, - "console": { - "description": "Console TCP port", - "minimum": 1, - "maximum": 65535, - "type": "integer" - }, - "enable_remote_console": { - "description": "Enable the remote console", - "type": "boolean" - }, - "headless": { - "description": "Headless mode", - "type": "boolean" - }, - "acpi_shutdown": { - "description": "ACPI shutdown", - "type": "boolean" - }, - "adapters": { - "description": "Number of adapters", - "type": "integer", - "minimum": 0, - "maximum": 10, # maximum adapters support by VMware VMs - }, - "adapter_type": { - "description": "VMware adapter type", - "type": "string", - "minLength": 1, - }, - "use_any_adapter": { - "description": "Allow GNS3 to use any VMware adapter", - "type": "boolean", - }, - }, - "additionalProperties": False, -} - VMWARE_OBJECT_SCHEMA = { "$schema": "http://json-schema.org/draft-04/schema#", @@ -203,7 +151,10 @@ VMWARE_OBJECT_SCHEMA = { "maximum": 65535, "type": "integer" }, + "linked_clone": { + "description": "Whether the VM is a linked clone or not", + "type": "boolean" + } }, - "additionalProperties": False, - "required": ["name", "node_id", "project_id"] + "additionalProperties": False }