mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-05 06:41:13 +02:00
Don't create directory structure during json dump. Fixes #2270
This commit is contained in:
1 parent
2a4ed9ba89
commit
3d85bba9d4
10 files changed
+35
-8
No files matched your search
@@ -207,7 +207,7 @@ class Project:
|
||||
:returns: Node working directory
|
||||
"""
|
||||
|
||||
workdir = os.path.join(self._path, "project-files", node.manager.module_name.lower(), node.id)
|
||||
workdir = self.node_working_path(node)
|
||||
if not self._deleted:
|
||||
try:
|
||||
os.makedirs(workdir, exist_ok=True)
|
||||
@@ -215,6 +215,15 @@ class Project:
|
||||
raise aiohttp.web.HTTPInternalServerError(text="Could not create the node working directory: {}".format(e))
|
||||
return workdir
|
||||
|
||||
def node_working_path(self, node):
|
||||
"""
|
||||
Returns a node working path for node. It doesn't create structure if not present on system.
|
||||
:param node: Node instance
|
||||
:return: Node working path
|
||||
"""
|
||||
return os.path.join(self._path, "project-files", node.manager.module_name.lower(), node.id)
|
||||
|
||||
|
||||
def tmp_working_directory(self):
|
||||
"""
|
||||
A temporary directory. Will be clean at project open and close
|
||||
|
||||
Reference in new issue
Block a user