From 65ac1e1d15e8470cfb94d851bc67cd6ecbb6e33d Mon Sep 17 00:00:00 2001 From: Yadnesh Kulkarni Date: Tue, 5 Jan 2021 21:51:03 +0530 Subject: [PATCH] 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 Change-Id: I641dd1c3426048f5aace0ac695eb8cef7126f8c2 (cherry picked from commit 6546970a7304e8d3109e99e980053d15d5769598) --- tripleoclient/v1/overcloud_image.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tripleoclient/v1/overcloud_image.py b/tripleoclient/v1/overcloud_image.py index e1562d8bf..97993a097 100644 --- a/tripleoclient/v1/overcloud_image.py +++ b/tripleoclient/v1/overcloud_image.py @@ -184,12 +184,12 @@ class FileImageClientAdapter(BaseClientAdapter): def get_image_property(self, image, prop): if prop == 'kernel_id': path = os.path.splitext(image.id)[0] + '.vmlinuz' - if os.path.exists(path): + if os.path.exists(path.replace("file://", "")): return path return None elif prop == 'ramdisk_id': path = os.path.splitext(image.id)[0] + '.initrd' - if os.path.exists(path): + if os.path.exists(path.replace("file://", "")): return path return None raise ValueError('Unsupported property %s' % prop)