mirror of
https://github.com/GNS3/gns3-server
synced 2025-05-28 19:58:53 +00:00
Catch error when you can't mark a project as no longer temporary
Fix #172
This commit is contained in:
parent
22efc7488f
commit
18c4154376
@ -152,8 +152,7 @@ class Project:
|
|||||||
try:
|
try:
|
||||||
shutil.rmtree(old_path)
|
shutil.rmtree(old_path)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
raise aiohttp.web.HTTPConflict("Can't remove temporary directory {}: {}".format(old_path ,e))
|
raise aiohttp.web.HTTPConflict("Can't remove temporary directory {}: {}".format(old_path, e))
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -241,7 +240,10 @@ class Project:
|
|||||||
raise aiohttp.web.HTTPInternalServerError(text="Could not create temporary project: {}".format(e))
|
raise aiohttp.web.HTTPInternalServerError(text="Could not create temporary project: {}".format(e))
|
||||||
else:
|
else:
|
||||||
if os.path.exists(os.path.join(self._path, ".gns3_temporary")):
|
if os.path.exists(os.path.join(self._path, ".gns3_temporary")):
|
||||||
os.remove(os.path.join(self._path, ".gns3_temporary"))
|
try:
|
||||||
|
os.remove(os.path.join(self._path, ".gns3_temporary"))
|
||||||
|
except OSError as e:
|
||||||
|
raise aiohttp.web.HTTPInternalServerError(text="Could not mark project as no longer temporary: {}".format(e))
|
||||||
|
|
||||||
def module_working_directory(self, module_name):
|
def module_working_directory(self, module_name):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user