From 126d1b677d0db98d3e2f3356809491e6f99420b0 Mon Sep 17 00:00:00 2001 From: Eric Ball Date: Fri, 24 Jan 2020 15:25:38 -0800 Subject: [PATCH] Call "lftools jenkins" after credentials are set 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 --- releasenotes/notes/fix-configure-clouds-e71e71c12c614de0.yaml | 9 +++++++++ shell/jenkins-configure-clouds.sh | 8 +++++--- 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/fix-configure-clouds-e71e71c12c614de0.yaml diff --git a/releasenotes/notes/fix-configure-clouds-e71e71c12c614de0.yaml b/releasenotes/notes/fix-configure-clouds-e71e71c12c614de0.yaml new file mode 100644 index 00000000..1a686676 --- /dev/null +++ b/releasenotes/notes/fix-configure-clouds-e71e71c12c614de0.yaml @@ -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. diff --git a/shell/jenkins-configure-clouds.sh b/shell/jenkins-configure-clouds.sh index 405ecedf..e5dba546 100644 --- a/shell/jenkins-configure-clouds.sh +++ b/shell/jenkins-configure-clouds.sh @@ -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}" -- 2.16.6