mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-31 05:13:49 +02:00
Fixes #270. Relative paths management with empty ones.
This commit is contained in:
parent
24bfd8ab53
commit
fa544ef888
@ -380,8 +380,9 @@ class BaseManager:
|
|||||||
:return: file path
|
:return: file path
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if not path:
|
||||||
|
return ""
|
||||||
img_directory = self.get_images_directory()
|
img_directory = self.get_images_directory()
|
||||||
|
|
||||||
if not os.path.isabs(path):
|
if not os.path.isabs(path):
|
||||||
s = os.path.split(path)
|
s = os.path.split(path)
|
||||||
return os.path.normpath(os.path.join(img_directory, *s))
|
return os.path.normpath(os.path.join(img_directory, *s))
|
||||||
@ -397,6 +398,8 @@ class BaseManager:
|
|||||||
:return: file path
|
:return: file path
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if not path:
|
||||||
|
return ""
|
||||||
img_directory = self.get_images_directory()
|
img_directory = self.get_images_directory()
|
||||||
path = self.get_abs_image_path(path)
|
path = self.get_abs_image_path(path)
|
||||||
if os.path.dirname(path) == img_directory:
|
if os.path.dirname(path) == img_directory:
|
||||||
@ -407,4 +410,5 @@ class BaseManager:
|
|||||||
"""
|
"""
|
||||||
Get the image directory on disk
|
Get the image directory on disk
|
||||||
"""
|
"""
|
||||||
|
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
Loading…
Reference in New Issue
Block a user