fix: extend remote compute image path conversion to all node types

Previously only the "path" field was converted to a relative path for remote computes, causing issues with QEMU and VMware nodes that use different image path fields. Now all known image path fields are converted, ensuring consistent behavior across IOU, QEMU, Dynamips, and VMware node types.
This commit is contained in:
YueGuobin committed 2026-05-04 15:39:16 +08:00
1 parent 6ff4f575bb
commit 38f5e8df76
2 files changed
+46 -8

No files matched your search

+15 -2
View File
@@ -542,8 +542,21 @@ class Node:
# For remote computes, convert absolute image paths to relative paths
# The remote compute will search for the image in its own configured directories
if self._compute.id != "local" and "path" in data and os.path.isabs(data["path"]):
data["path"] = os.path.basename(data["path"])
if self._compute.id != "local":
# Image path fields for various node types
image_path_fields = {
# Common fields (IOU, Docker, etc.)
"path", "image",
# QEMU-specific fields
"hda_disk_image", "hdb_disk_image", "hdc_disk_image", "hdd_disk_image",
"cdrom_image", "bios_image", "initrd", "kernel_image",
# VMware-specific fields
"vmx_path",
}
for field in image_path_fields:
if field in data and data[field] and os.path.isabs(data[field]):
data[field] = os.path.basename(data[field])
if self._console:
# console is optional for builtin nodes