If image is not found in VM directory look in images folder

This commit is contained in:
Julien Duponchelle committed 2015-05-04 10:57:08 +02:00
1 parent 3467b42ab5
commit 0dea63c9ea
2 files changed
+17 -1

No files matched your search

+10 -1
View File
@@ -386,7 +386,16 @@ class BaseManager:
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))
path = os.path.normpath(os.path.join(img_directory, *s))
# Compatibility with old topologies we look in parent directory
# We look at first in new location
if not os.path.exists(path):
old_path = os.path.normpath(os.path.join(img_directory, '..', *s))
if os.path.exists(old_path):
return old_path
return path
return path
def get_relative_image_path(self, path):