Do not fail config management verify if no cloud 04/65604/2
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Wed, 23 Sep 2020 16:39:20 +0000 (09:39 -0700)
committerAndrew Grimberg <agrimberg@linuxfoundation.org>
Wed, 23 Sep 2020 16:44:05 +0000 (09:44 -0700)
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 <agrimberg@linuxfoundation.org>
releasenotes/notes/fix_jenkins_image_verify-b2588bd58ddc2f83.yaml [new file with mode: 0644]
shell/jenkins-verify-images.sh

diff --git a/releasenotes/notes/fix_jenkins_image_verify-b2588bd58ddc2f83.yaml b/releasenotes/notes/fix_jenkins_image_verify-b2588bd58ddc2f83.yaml
new file mode 100644 (file)
index 0000000..7317e63
--- /dev/null
@@ -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
index d005c52..663dfb6 100755 (executable)
@@ -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