Don't create directory structure during json dump. Fixes #2270

This commit is contained in:
ziajka committed 2017-10-02 10:41:57 +02:00
1 parent 2a4ed9ba89
commit 3d85bba9d4
10 files changed
+35 -8

No files matched your search

+10 -1
View File
@@ -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