From: Andrew Grimberg Date: Wed, 23 Sep 2020 16:39:20 +0000 (-0700) Subject: Do not fail config management verify if no cloud X-Git-Tag: v0.57.4~3 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=9e03c09dca03eaa59d61b624539f77d1343ca384;p=releng%2Fglobal-jjb.git Do not fail config management verify if no cloud Not having any openstack clouds defined is not a failure condition for the config management. We already support skipping configuration (the merge job) if there isn't a clouds config, but for some reason our verify is trying to force that. This fixes the problem. Change-Id: Ic48b91ef07808403b6214c6272bcd930e21a0af8 Signed-off-by: Andrew Grimberg --- diff --git a/releasenotes/notes/fix_jenkins_image_verify-b2588bd58ddc2f83.yaml b/releasenotes/notes/fix_jenkins_image_verify-b2588bd58ddc2f83.yaml new file mode 100644 index 00000000..7317e63d --- /dev/null +++ b/releasenotes/notes/fix_jenkins_image_verify-b2588bd58ddc2f83.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + When evaluating jenkins-config management changes, if a system does not have + an openstack cloud defined, we should not fail the job. Instead we now + just skip that configuration and verification diff --git a/shell/jenkins-verify-images.sh b/shell/jenkins-verify-images.sh index d005c52f..663dfb6e 100755 --- a/shell/jenkins-verify-images.sh +++ b/shell/jenkins-verify-images.sh @@ -40,18 +40,20 @@ verify_images() } echo "Verifying that cloud has a master configuration file" -for cloud in jenkins-config/clouds/openstack/*; do - if [[ -f $cloud/cloud.cfg ]]; then - # Get the OS_CLOUD variable from cloud config - if ! os_cloud=$(grep -E "^OS_CLOUD=" "$cloud/cloud.cfg" | cut -d'=' -f2); then - os_cloud="vex" +if [[ -d jenkins-config/clouds/openstack ]]; then + for cloud in jenkins-config/clouds/openstack/*; do + if [[ -f $cloud/cloud.cfg ]]; then + # Get the OS_CLOUD variable from cloud config + if ! os_cloud=$(grep -E "^OS_CLOUD=" "$cloud/cloud.cfg" | cut -d'=' -f2); then + os_cloud="vex" + fi + OS_CLOUD=$os_cloud verify_images "$cloud" + else + echo "ERROR: No cloud.cfg for $cloud" + error=true fi - OS_CLOUD=$os_cloud verify_images "$cloud" - else - echo "ERROR: No cloud.cfg for $cloud" - error=true - fi -done + done +fi if $error; then exit 1