Use project_id instead of project_uuid for the API.

This commit is contained in:
Jeremy committed 2015-02-03 18:40:13 -07:00
1 parent d2699f051d
commit 59c82e26df
8 files changed
+30 -30

No files matched your search

+7 -7
View File
@@ -42,23 +42,23 @@ class ProjectManager:
cls._instance = cls()
return cls._instance
def get_project(self, project_uuid):
def get_project(self, uuid):
"""
Returns a Project instance.
:param project_uuid: Project UUID
:param uuid: Project UUID
:returns: Project instance
"""
try:
UUID(project_uuid, version=4)
UUID(uuid, version=4)
except ValueError:
raise aiohttp.web.HTTPBadRequest(text="{} is not a valid UUID".format(project_uuid))
raise aiohttp.web.HTTPBadRequest(text="{} is not a valid UUID".format(uuid))
if project_uuid not in self._projects:
raise aiohttp.web.HTTPNotFound(text="Project UUID {} doesn't exist".format(project_uuid))
return self._projects[project_uuid]
if uuid not in self._projects:
raise aiohttp.web.HTTPNotFound(text="Project UUID {} doesn't exist".format(uuid))
return self._projects[uuid]
def create_project(self, **kwargs):
"""
@@ -79,7 +79,7 @@ class VirtualBoxVM(BaseVM):
return {"name": self.name,
"uuid": self.uuid,
"console": self.console,
"project_uuid": self.project.uuid,
"project_id": self.project.uuid,
"vmname": self.vmname,
"headless": self.headless,
"enable_remote_console": self.enable_remote_console,
+1 -1
View File
@@ -107,7 +107,7 @@ class VPCSVM(BaseVM):
return {"name": self.name,
"uuid": self.uuid,
"console": self._console,
"project_uuid": self.project.uuid,
"project_id": self.project.uuid,
"script_file": self.script_file,
"startup_script": self.startup_script}