Sub directory project-files

This commit is contained in:
Julien Duponchelle 2015-02-09 11:26:22 +01:00
parent e99c0f6ac5
commit b31af0abcd
2 changed files with 2 additions and 2 deletions

View File

@ -170,7 +170,7 @@ class Project:
:returns: A string with a VM working directory
"""
workdir = os.path.join(self._path, vm.manager.module_name.lower(), vm.id)
workdir = os.path.join(self._path, 'project-files', vm.manager.module_name.lower(), vm.id)
try:
os.makedirs(workdir, exist_ok=True)
except OSError as e:

View File

@ -115,8 +115,8 @@ def test_json(tmpdir):
def test_vm_working_directory(tmpdir, vm):
with patch("gns3server.config.Config.get_section_config", return_value={"local": True}):
p = Project(location=str(tmpdir))
assert p.vm_working_directory(vm) == os.path.join(str(tmpdir), p.id, 'project-files', vm.module_name, vm.id)
assert os.path.exists(p.vm_working_directory(vm))
assert os.path.exists(os.path.join(str(tmpdir), p.id, vm.module_name, vm.id))
def test_mark_vm_for_destruction(vm):