Do not fail config management verify if no cloud
[releng/global-jjb.git] / shell / jenkins-verify-images.sh
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