Makes absolute path checks work on Windows.

This commit is contained in:
grossmj
2015-03-07 18:16:46 -07:00
parent be1e0fa1f2
commit 0d379f428e
3 changed files with 4 additions and 5 deletions

View File

@ -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)