Makes absolute path checks work on Windows.

pull/100/head
grossmj 9 years ago
parent be1e0fa1f2
commit 0d379f428e

@ -421,8 +421,7 @@ class Router(BaseVM):
:param image: path to IOS image file
"""
if not os.path.dirname(image):
# this must be a relative path
if not os.path.isabs(image):
server_config = Config.instance().get_section_config("Server")
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
"""
if path[0] != "/":
if not os.path.isabs(path):
server_config = Config.instance().get_section_config("Server")
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
"""
if hda_disk_image[0] != "/":
if os.path.isabs(hda_disk_image):
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)
@ -210,7 +210,7 @@ class QemuVM(BaseVM):
: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")
hdb_disk_image = os.path.join(os.path.expanduser(server_config.get("images_path", "~/GNS3/images")), hdb_disk_image)

Loading…
Cancel
Save