Merge "Call "lftools jenkins" after credentials are set"
authorEric Ball <eball@linuxfoundation.org>
Mon, 27 Jan 2020 15:54:44 +0000 (15:54 +0000)
committerGerrit Code Review <gerrit@linuxfoundation.org>
Mon, 27 Jan 2020 15:54:44 +0000 (15:54 +0000)
releasenotes/notes/fix-configure-clouds-e71e71c12c614de0.yaml [new file with mode: 0644]
shell/jenkins-configure-clouds.sh

diff --git a/releasenotes/notes/fix-configure-clouds-e71e71c12c614de0.yaml b/releasenotes/notes/fix-configure-clouds-e71e71c12c614de0.yaml
new file mode 100644 (file)
index 0000000..1a68667
--- /dev/null
@@ -0,0 +1,9 @@
+---
+fixes:
+  - |
+    Call "lftools jenkins" after credentials are set to fix failures due to the
+    call being made without credentials being set first. The previous method
+    did not require credentials, so the failure was introduced when we switched
+    to using lftools. The os_plugin_version variable is not needed before the
+    JENKINS_USER and JENKINS_PASSWORD are set, so no other changes
+    are necessary.
index 405eced..e5dba54 100644 (file)
@@ -46,9 +46,6 @@ silos="${jenkins_silos:-jenkins}"
 
 set -eu -o pipefail
 
-os_plugin_version="$(lftools jenkins plugins list \
-  | grep -i 'OpenStack Cloud Plugin')"
-
 testversion() {
     local current_val="$1" operator="$2" test_value="$3"
     awk -vv1="$current_val" -vv2="$test_value" 'BEGIN {
@@ -319,6 +316,11 @@ for silo in $silos; do
     export JENKINS_USER
     export JENKINS_PASSWORD
 
+    # JENKINS_{URL,USER,PASSWORD} env vars are required for the "lftools jenkins
+    # plugins list" call
+    os_plugin_version="$(lftools jenkins plugins list \
+      | grep -i 'OpenStack Cloud Plugin')"
+
     echo "-----> Groovy script $script_file"
     for cloud in "${clouds[@]}"; do
         cfg_dir="${cloud}"