|
|
|
@ -162,8 +162,7 @@ class BaseManager:
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
new_id = str(uuid4())
|
|
|
|
|
project_name = os.path.basename(project.path)
|
|
|
|
|
legacy_project_files_path = os.path.join(project.path, "{}-files".format(project_name))
|
|
|
|
|
legacy_project_files_path = os.path.join(project.path, "{}-files".format(project.name))
|
|
|
|
|
new_project_files_path = os.path.join(project.path, "project-files")
|
|
|
|
|
if os.path.exists(legacy_project_files_path) and not os.path.exists(new_project_files_path):
|
|
|
|
|
# move the project files
|
|
|
|
@ -175,16 +174,18 @@ 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 project.is_local() is False:
|
|
|
|
|
legacy_remote_iou_project = os.path.join(project.location, project.name, "iou")
|
|
|
|
|
new_iou_project_path = os.path.join(project.path, "project-files", "iou")
|
|
|
|
|
if os.path.exists(legacy_remote_iou_project) and not os.path.exists(new_iou_project_path):
|
|
|
|
|
# move the legacy remote IOU project (remote servers only)
|
|
|
|
|
log.info("Converting old remote IOU project...")
|
|
|
|
|
try:
|
|
|
|
|
log.info('Moving "{}" to "{}"'.format(legacy_remote_iou_project, new_iou_project_path))
|
|
|
|
|
yield from wait_run_in_executor(shutil.move, legacy_remote_iou_project, new_iou_project_path)
|
|
|
|
|
except OSError as e:
|
|
|
|
|
raise aiohttp.web.HTTPInternalServerError(text="Could not move IOU directory: {} to {} {}".format(legacy_remote_iou_project,
|
|
|
|
|
new_iou_project_path, e))
|
|
|
|
|
|
|
|
|
|
if hasattr(self, "get_legacy_vm_workdir"):
|
|
|
|
|
# rename old project VM working dir
|
|
|
|
|