From fa544ef888f2e5ee59e1574ae0ea6214bb1811e9 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Fri, 24 Apr 2015 17:27:32 -0600 Subject: [PATCH] Fixes #270. Relative paths management with empty ones. --- gns3server/modules/base_manager.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gns3server/modules/base_manager.py b/gns3server/modules/base_manager.py index d6097fce..9dbc6fb8 100644 --- a/gns3server/modules/base_manager.py +++ b/gns3server/modules/base_manager.py @@ -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