Strip user from compute in topology and return project filename

This commit is contained in:
Julien Duponchelle
2016-06-15 18:22:11 +02:00
parent c4d619ce3c
commit aa5988788d
5 changed files with 14 additions and 8 deletions

View File

@ -322,12 +322,14 @@ class Project:
raise aiohttp.web.HTTPInternalServerError(text="Could not create project directory: {}".format(e))
return path
def _topology_file(self):
def _filename(self):
if self.name is None:
filename = "untitled.gns3"
return "untitled.gns3"
else:
filename = self.name + ".gns3"
return os.path.join(self.path, filename)
return self.name + ".gns3"
def _topology_file(self):
return os.path.join(self.path, self._filename())
@asyncio.coroutine
def open(self):
@ -371,5 +373,6 @@ class Project:
"name": self._name,
"project_id": self._id,
"path": self._path,
"filename": self._filename(),
"status": self._status
}