Return vm_directory for VirtualBox and VMware

Fix #246
This commit is contained in:
Julien Duponchelle committed 2015-06-26 17:09:19 +02:00
1 parent feefb075d4
commit 6e3ebb714d
6 files changed
+80 -4

No files matched your search

@@ -74,7 +74,7 @@ class VirtualBoxVM(BaseVM):
def __json__(self):
return {"name": self.name,
json = {"name": self.name,
"vm_id": self.id,
"console": self.console,
"project_id": self.project.id,
@@ -86,6 +86,11 @@ class VirtualBoxVM(BaseVM):
"adapter_type": self.adapter_type,
"ram": self.ram,
"use_any_adapter": self.use_any_adapter}
if self._linked_clone:
json["vm_directory"] = self.working_dir
else:
json["vm_directory"] = None
return json
@asyncio.coroutine
def _get_system_properties(self):
+7 -2
View File
@@ -78,11 +78,11 @@ class VMwareVM(BaseVM):
self._use_any_adapter = False
if not os.path.exists(vmx_path):
raise VMwareError('VMware VM "{name}" [{id}]: could not find VMX file "{}"'.format(name, vmx_path))
raise VMwareError('VMware VM "{name}" [{id}]: could not find VMX file "{vmx_path}"'.format(name=name, id=vm_id, vmx_path=vmx_path))
def __json__(self):
return {"name": self.name,
json = {"name": self.name,
"vm_id": self.id,
"console": self.console,
"project_id": self.project.id,
@@ -93,6 +93,11 @@ class VMwareVM(BaseVM):
"adapters": self._adapters,
"adapter_type": self.adapter_type,
"use_any_adapter": self.use_any_adapter}
if self._linked_clone:
json["vm_directory"] = self.working_dir
else:
json["vm_directory"] = None
return json
@property
def vmnets(self):
+5 -1
View File
@@ -191,6 +191,10 @@ VBOX_OBJECT_SCHEMA = {
"type": "string",
"minLength": 1,
},
"vm_directory": {
"decription": "Path to the VM working directory",
"type": ["string", "null"]
},
"enable_remote_console": {
"description": "enable the remote console",
"type": "boolean"
@@ -232,5 +236,5 @@ VBOX_OBJECT_SCHEMA = {
},
},
"additionalProperties": False,
"required": ["name", "vm_id", "project_id"]
"required": ["name", "vm_id", "project_id", "vm_directory"]
}
+4
View File
@@ -149,6 +149,10 @@ VMWARE_OBJECT_SCHEMA = {
"maxLength": 36,
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"vm_directory": {
"decription": "Path to the VM working directory",
"type": ["string", "null"]
},
"project_id": {
"description": "Project UUID",
"type": "string",