X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fjenkins-configure-clouds.sh;h=06cb4a3d13b09bdfea42ad07de5249312e5d0979;hb=532e97b5b965cab5ace406d8ecc845afc98920ac;hp=cc6a4eec500d0f1503856c4643971da15e0caaf4;hpb=b478f21f36b3ff13d9508bb8c0f71890d4c96938;p=releng%2Fglobal-jjb.git diff --git a/shell/jenkins-configure-clouds.sh b/shell/jenkins-configure-clouds.sh index cc6a4eec..06cb4a3d 100644 --- a/shell/jenkins-configure-clouds.sh +++ b/shell/jenkins-configure-clouds.sh @@ -49,13 +49,13 @@ set -eu -o pipefail testversion() { local current_val="$1" operator="$2" test_value="$3" awk -vv1="$current_val" -vv2="$test_value" 'BEGIN { - split(v1, a, /\:/); - if (a[2] == '"$test_value"') { - exit (a[2] == '"$test_value"') ? 0 : 1 - } - else { - exit (a[2] '"$operator"' '"$test_value"') ? 0 : 1 - } + split(v1, a, /\:/); + if (a[2] == '"$test_value"') { + exit (a[2] == '"$test_value"') ? 0 : 1 + } + else { + exit (a[2] '"$operator"' '"$test_value"') ? 0 : 1 + } }' } @@ -237,11 +237,11 @@ get_minion_options() { # Handle specifying the minimum instance count across different versions if testversion "$os_plugin_version" '>=' '2.47' then - instance_min=$(get_cfg "$cfg_file" INSTANCE_MIN "null") - echo " $instance_min," + instance_min=$(get_cfg "$cfg_file" INSTANCE_MIN "null") + echo " $instance_min," else - instance_min=$(get_cfg "$cfg_file" INSTANCE_MIN_CAPMAX "null") - echo " $instance_min," + instance_min=$(get_cfg "$cfg_file" INSTANCE_MIN_CAPMAX "null") + echo " $instance_min," fi echo " \"$floating_ip_pool\"," @@ -256,11 +256,11 @@ get_minion_options() { if testversion "$os_plugin_version" '>=' '2.47' then - echo " $node_properties," - echo " $retention_time", - echo " $config_drive" + echo " $node_properties," + echo " $retention_time", + echo " $config_drive" else - echo " $retention_time" + echo " $retention_time" fi @@ -292,6 +292,10 @@ get_template_cfg() { echo ")" } +# shellcheck disable=SC1090 +. ~/lf-env.sh + +lf-activate-venv --python python3 lftools mapfile -t clouds < <(ls -d1 "$OS_CLOUD_DIR"/*/) @@ -322,7 +326,7 @@ for silo in $silos; do # 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')" + | grep -i 'OpenStack Cloud Plugin')" echo "-----> Groovy script $script_file" for cloud in "${clouds[@]}"; do