mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-18 07:23:47 +02:00
Fixes race condition when deleting empty legacy project files dir.
This commit is contained in:
parent
473eb0280e
commit
9dc713f31d
@ -177,20 +177,14 @@ class BaseManager:
|
|||||||
raise aiohttp.web.HTTPInternalServerError(text="Could not move VM working directory: {} to {} {}".format(vm_working_dir, new_vm_working_dir, e))
|
raise aiohttp.web.HTTPInternalServerError(text="Could not move VM working directory: {} to {} {}".format(vm_working_dir, new_vm_working_dir, e))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if not os.listdir(module_path):
|
os.rmdir(module_path)
|
||||||
os.rmdir(module_path)
|
except OSError:
|
||||||
except OSError as e:
|
pass
|
||||||
raise aiohttp.web.HTTPInternalServerError(text="Could not delete {}: {}".format(module_path, e))
|
|
||||||
except FileNotFoundError as e:
|
|
||||||
log.warning(e)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if not os.listdir(project_files_dir):
|
os.rmdir(project_files_dir)
|
||||||
os.rmdir(project_files_dir)
|
except OSError:
|
||||||
except OSError as e:
|
pass
|
||||||
raise aiohttp.web.HTTPInternalServerError(text="Could not delete {}: {}".format(project_files_dir, e))
|
|
||||||
except FileNotFoundError as e:
|
|
||||||
log.warning(e)
|
|
||||||
|
|
||||||
if not vm_id:
|
if not vm_id:
|
||||||
vm_id = str(uuid4())
|
vm_id = str(uuid4())
|
||||||
|
Loading…
Reference in New Issue
Block a user