Overcloud image has missing kernel_id and ramdisk_id properties
Kernel and ramdisk images are found nonexistent when "file://"
is prepended to the image path, so replace it with empty
string only when checking the existence of the image
Closes-Bug: #1896262
Signed-off-by: Yadnesh Kulkarni <ykulkarn@redhat.com>
Change-Id: I641dd1c3426048f5aace0ac695eb8cef7126f8c2
(cherry picked from commit 6546970a73
)
This commit is contained in:
parent
2ec53c2a7b
commit
65ac1e1d15
|
@ -184,12 +184,12 @@ class FileImageClientAdapter(BaseClientAdapter):
|
||||||
def get_image_property(self, image, prop):
|
def get_image_property(self, image, prop):
|
||||||
if prop == 'kernel_id':
|
if prop == 'kernel_id':
|
||||||
path = os.path.splitext(image.id)[0] + '.vmlinuz'
|
path = os.path.splitext(image.id)[0] + '.vmlinuz'
|
||||||
if os.path.exists(path):
|
if os.path.exists(path.replace("file://", "")):
|
||||||
return path
|
return path
|
||||||
return None
|
return None
|
||||||
elif prop == 'ramdisk_id':
|
elif prop == 'ramdisk_id':
|
||||||
path = os.path.splitext(image.id)[0] + '.initrd'
|
path = os.path.splitext(image.id)[0] + '.initrd'
|
||||||
if os.path.exists(path):
|
if os.path.exists(path.replace("file://", "")):
|
||||||
return path
|
return path
|
||||||
return None
|
return None
|
||||||
raise ValueError('Unsupported property %s' % prop)
|
raise ValueError('Unsupported property %s' % prop)
|
||||||
|
|
Loading…
Reference in New Issue