1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-28 11:18:11 +00:00

Fixes #270. Relative paths management with empty ones.

This commit is contained in:
Jeremy 2015-04-24 17:27:32 -06:00
parent 24bfd8ab53
commit fa544ef888

View File

@ -380,8 +380,9 @@ class BaseManager:
:return: file path
"""
if not path:
return ""
img_directory = self.get_images_directory()
if not os.path.isabs(path):
s = os.path.split(path)
return os.path.normpath(os.path.join(img_directory, *s))
@ -397,6 +398,8 @@ class BaseManager:
:return: file path
"""
if not path:
return ""
img_directory = self.get_images_directory()
path = self.get_abs_image_path(path)
if os.path.dirname(path) == img_directory:
@ -407,4 +410,5 @@ class BaseManager:
"""
Get the image directory on disk
"""
raise NotImplementedError