Merge branch '2.2' into 3.0

# Conflicts:
#	gns3server/compute/base_manager.py
#	gns3server/handlers/api/compute/dynamips_vm_handler.py
#	gns3server/handlers/api/compute/iou_handler.py
#	gns3server/handlers/api/compute/project_handler.py
#	gns3server/handlers/api/compute/qemu_handler.py
#	gns3server/handlers/api/controller/node_handler.py
#	gns3server/handlers/api/controller/project_handler.py
#	gns3server/handlers/index_handler.py
#	tests/handlers/api/compute/test_project.py
#	tests/handlers/api/compute/test_qemu.py
#	tests/handlers/api/controller/test_node.py
#	tests/handlers/api/controller/test_project.py
This commit is contained in:
grossmj committed 2021-05-15 20:46:34 +09:30
commit 09ac7fd7fb
12 files changed
+599 -3

No files matched your search

+4 -3
View File
@@ -417,7 +417,7 @@ class BaseManager:
if not path or path == ".":
return ""
orig_path = path
orig_path = os.path.normpath(path)
img_directory = self.get_images_directory()
valid_directory_prefices = images_directories(self._NODE_TYPE)
@@ -431,7 +431,8 @@ class BaseManager:
f"'{path}' is not allowed on this remote server. Please only use a file from '{img_directory}'"
)
if not os.path.isabs(path):
if not os.path.isabs(orig_path):
for directory in valid_directory_prefices:
log.debug(f"Searching for image '{orig_path}' in '{directory}'")
path = self._recursive_search_file_in_directory(directory, orig_path)
@@ -475,7 +476,7 @@ class BaseManager:
for root, dirs, files in os.walk(directory):
for file in files:
# If filename is the same
if s[1] == file and (s[0] == "" or s[0] == os.path.basename(root)):
if s[1] == file and (s[0] == '' or os.path.basename(s[0]) == os.path.basename(root)):
path = os.path.normpath(os.path.join(root, s[1]))
if os.path.exists(path):
return path