mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-24 15:58:08 +00:00
Convert legacy IOU directories on remote servers.
This commit is contained in:
parent
b1eccc0ace
commit
2934232afb
@ -175,6 +175,17 @@ class BaseManager:
|
|||||||
raise aiohttp.web.HTTPInternalServerError(text="Could not move project files directory: {} to {} {}".format(legacy_project_files_path,
|
raise aiohttp.web.HTTPInternalServerError(text="Could not move project files directory: {} to {} {}".format(legacy_project_files_path,
|
||||||
new_project_files_path, e))
|
new_project_files_path, e))
|
||||||
|
|
||||||
|
legacy_iou_dir = os.path.join(project.path, "iou")
|
||||||
|
new_iou_dir = os.path.join(project.path, "project-files", "iou")
|
||||||
|
if os.path.exists(legacy_iou_dir) and not os.path.exists(new_iou_dir):
|
||||||
|
# move the iou dir on remote server
|
||||||
|
try:
|
||||||
|
log.info('Moving "{}" to "{}"'.format(legacy_iou_dir, new_iou_dir))
|
||||||
|
yield from wait_run_in_executor(shutil.move, legacy_iou_dir, new_iou_dir)
|
||||||
|
except OSError as e:
|
||||||
|
raise aiohttp.web.HTTPInternalServerError(text="Could not move IOU directory: {} to {} {}".format(legacy_iou_dir,
|
||||||
|
new_iou_dir, e))
|
||||||
|
|
||||||
if hasattr(self, "get_legacy_vm_workdir"):
|
if hasattr(self, "get_legacy_vm_workdir"):
|
||||||
# rename old project VM working dir
|
# rename old project VM working dir
|
||||||
log.info("Converting old VM working directory...")
|
log.info("Converting old VM working directory...")
|
||||||
|
Loading…
Reference in New Issue
Block a user