We have been seeing failures due to the "lftools jenkins plugins"
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 this part of the script, so by moving the
assignment to after JENKINS_USER and JENKINS_PASSWORD are set, the
script is once again successful.
Issue: IT-18593
Change-Id: Ib3e6099992abade5860eedd1bda07015b13f0f91
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
--- /dev/null
+---
+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.
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 {
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}"