mirror of
https://github.com/GNS3/gns3-server
synced 2025-01-23 14:31:03 +00:00
Makes absolute path checks work on Windows.
This commit is contained in:
parent
be1e0fa1f2
commit
0d379f428e
@ -421,8 +421,7 @@ class Router(BaseVM):
|
|||||||
:param image: path to IOS image file
|
:param image: path to IOS image file
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if not os.path.dirname(image):
|
if not os.path.isabs(image):
|
||||||
# this must be a relative path
|
|
||||||
server_config = Config.instance().get_section_config("Server")
|
server_config = Config.instance().get_section_config("Server")
|
||||||
image = os.path.join(os.path.expanduser(server_config.get("images_path", "~/GNS3/images")), image)
|
image = os.path.join(os.path.expanduser(server_config.get("images_path", "~/GNS3/images")), image)
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ class IOUVM(BaseVM):
|
|||||||
:params path: Path to the binary
|
:params path: Path to the binary
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if path[0] != "/":
|
if not os.path.isabs(path):
|
||||||
server_config = Config.instance().get_section_config("Server")
|
server_config = Config.instance().get_section_config("Server")
|
||||||
path = os.path.join(os.path.expanduser(server_config.get("images_path", "~/GNS3/images")), path)
|
path = os.path.join(os.path.expanduser(server_config.get("images_path", "~/GNS3/images")), path)
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ class QemuVM(BaseVM):
|
|||||||
:param hda_disk_image: QEMU hda disk image path
|
:param hda_disk_image: QEMU hda disk image path
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if hda_disk_image[0] != "/":
|
if os.path.isabs(hda_disk_image):
|
||||||
server_config = Config.instance().get_section_config("Server")
|
server_config = Config.instance().get_section_config("Server")
|
||||||
hda_disk_image = os.path.join(os.path.expanduser(server_config.get("images_path", "~/GNS3/images")), hda_disk_image)
|
hda_disk_image = os.path.join(os.path.expanduser(server_config.get("images_path", "~/GNS3/images")), hda_disk_image)
|
||||||
|
|
||||||
@ -210,7 +210,7 @@ class QemuVM(BaseVM):
|
|||||||
:param hdb_disk_image: QEMU hdb disk image path
|
:param hdb_disk_image: QEMU hdb disk image path
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if hdb_disk_image[0] != "/":
|
if not os.path.isabs(hdb_disk_image):
|
||||||
server_config = Config.instance().get_section_config("Server")
|
server_config = Config.instance().get_section_config("Server")
|
||||||
hdb_disk_image = os.path.join(os.path.expanduser(server_config.get("images_path", "~/GNS3/images")), hdb_disk_image)
|
hdb_disk_image = os.path.join(os.path.expanduser(server_config.get("images_path", "~/GNS3/images")), hdb_disk_image)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user