Export vpcs config path

This commit is contained in:
Julien Duponchelle committed 2015-02-27 13:38:57 +01:00
1 parent 985c23a40e
commit ebb865d973
3 files changed
+23 -2

No files matched your search

+16 -1
View File
@@ -106,7 +106,22 @@ class VPCSVM(BaseVM):
"vm_id": self.id,
"console": self._console,
"project_id": self.project.id,
"startup_script": self.startup_script}
"startup_script": self.startup_script,
"startup_script_path": self.relative_startup_script}
@property
def relative_startup_script(self):
"""
Returns the startup config file relative to the project directory.
:returns: path to config file. None if the file doesn't exist
"""
path = os.path.join(self.working_dir, 'startup.vpc')
if os.path.exists(path):
return 'startup.vpc'
else:
return None
@property
def vpcs_path(self):
+5 -1
View File
@@ -165,7 +165,11 @@ VPCS_OBJECT_SCHEMA = {
"description": "Content of the VPCS startup script",
"type": ["string", "null"]
},
"startup_script_path": {
"description": "Path of the VPCS startup script relative to project directory",
"type": ["string", "null"]
},
},
"additionalProperties": False,
"required": ["name", "vm_id", "console", "project_id"]
"required": ["name", "vm_id", "console", "project_id", "startup_script_path"]
}