From 2934232afb1f165d9c31bdbb60efd954c539909a Mon Sep 17 00:00:00 2001 From: grossmj Date: Sun, 8 Mar 2015 17:45:29 -0600 Subject: [PATCH] Convert legacy IOU directories on remote servers. --- gns3server/modules/base_manager.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gns3server/modules/base_manager.py b/gns3server/modules/base_manager.py index f6b43175..49e9ace7 100644 --- a/gns3server/modules/base_manager.py +++ b/gns3server/modules/base_manager.py @@ -175,6 +175,17 @@ class BaseManager: raise aiohttp.web.HTTPInternalServerError(text="Could not move project files directory: {} to {} {}".format(legacy_project_files_path, 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"): # rename old project VM working dir log.info("Converting old VM working directory...")