From 8afc8de25e15ba323c5dd2186898c102bd543a95 Mon Sep 17 00:00:00 2001 From: Pete Zaitcev Date: Wed, 21 Oct 2020 23:01:28 -0500 Subject: [PATCH] Improve the error message about image tags The origial message made no grammatic sense, especially for the non-native speakers, who were unable to fill in the blanks where the errors were. Change-Id: I8f31886fcf8898c7844ce0b67e5006f592408f0f --- tripleoclient/v1/overcloud_image.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tripleoclient/v1/overcloud_image.py b/tripleoclient/v1/overcloud_image.py index 0ad9b64b8..5b285727d 100644 --- a/tripleoclient/v1/overcloud_image.py +++ b/tripleoclient/v1/overcloud_image.py @@ -592,12 +592,17 @@ class UploadOvercloudImage(command.Command): img_ramdisk_id = self.adapter.get_image_property( overcloud_image, 'ramdisk_id') # check overcloud image links - if (img_kernel_id != kernel.id or - img_ramdisk_id != ramdisk.id): - self.log.error('Link overcloud image to it\'s initrd and ' - 'kernel images is MISSING OR leads to OLD ' - 'image. You can keep it or fix it ' - 'manually.') + if img_kernel_id is None or img_ramdisk_id is None: + self.log.error('Link of overcloud image %s to its initrd' + ' or kernel images is MISSING.' + 'You can keep it or fix it manually.' % + overcloud_image.name) + elif (img_kernel_id != kernel.id or + img_ramdisk_id != ramdisk.id): + self.log.error('Link of overcloud image %s to its initrd' + ' or kernel images leads to OLD image.' + 'You can keep it or fix it manually.' % + overcloud_image.name) else: overcloud_image = self.adapter.update_or_upload(