From: Andrew Grimberg Date: Mon, 18 Nov 2019 17:47:44 +0000 (-0800) Subject: Fix OS_CLOUD export for image validation X-Git-Tag: v0.48.1 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;ds=inline;h=b5f3af3709b73e4207d21999e38160ba9ea6eab2;hp=d6e0198a565eff38a881d8b7c9f629764d7c2c24;p=releng%2Fglobal-jjb.git Fix OS_CLOUD export for image validation Change fe2beb15bc9effb5b91ba17b520ab6c167dd6604 introduced a bug where the CLOUD_CREDENTIAL_ID was being used for the OS_CLOUD export variable. This was done since the test for multi-cloud image validation had the credential IDs matching the OS_CLOUD variable. However, most of our systems have the CLOUD_CREDENTIAL_ID set to the default of 'os-cloud' and therefore after pulling updating to a global-jjb with that change would no longer be able to validate images! We now look for an OS_CLOUD variable in the cloud.cfg file and use it if it is set, otherwise we default to an OS_CLOUD of 'vex' as we previously did before change fe2beb15bc9effb5b91ba17b520ab6c167dd6604 Change-Id: I0af763495fa3a7ce2e8c080324abaf5d384e5188 Signed-off-by: Andrew Grimberg --- diff --git a/releasenotes/notes/fix-multi-cloud-validator-dedb41f09bb82a81.yaml b/releasenotes/notes/fix-multi-cloud-validator-dedb41f09bb82a81.yaml new file mode 100644 index 00000000..cfca7ba9 --- /dev/null +++ b/releasenotes/notes/fix-multi-cloud-validator-dedb41f09bb82a81.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Change multi-cloud image validation to look for an OS_CLOUD variable in the + cloud.cfg instead of overloading CLOUD_CREDENTIAL_ID as that variable + does not usually point to an ID that is in the openstack clouds.yaml file. diff --git a/shell/jenkins-verify-images.sh b/shell/jenkins-verify-images.sh index f05e3c35..e4e9e708 100755 --- a/shell/jenkins-verify-images.sh +++ b/shell/jenkins-verify-images.sh @@ -44,7 +44,8 @@ for cloud in jenkins-config/clouds/openstack/*; do # Verify that we have a cloud config file if [ -f "$cloud/cloud.cfg" ]; then # Get the OS_CLOUD variable from cloud config and export it - OS_CLOUD=$(grep ^CLOUD_CREDENTIAL_ID= "$cloud/cloud.cfg" | cut -d'=' -f2) + os_cloud=$(grep ^OS_CLOUD= "$cloud/cloud.cfg" | cut -d'=' -f2) + OS_CLOUD="${os_cloud:-vex}" export OS_CLOUD verify_images "$cloud"