Don't use array to fix SC2027 shellcheck error
[releng/builder.git] / jjb / integration / copy-common-functions.sh
index 8d3e85d73e3754e0b9b649e8d715fd352e9e4a23..e0eacdf0c1bb5dfba298f0790a1684e3f963a2ba 100644 (file)
@@ -12,9 +12,7 @@ if [ "${BASH_SOURCE[0]}" == "${0}" ]; then
     cp "${0}" /tmp/common-functions.sh
 
     source /tmp/v/openstack/bin/activate
-    # shellcheck disable=SC2207
-    ips=($(openstack stack show -f json -c outputs "$STACK_NAME" | \
-               jq -r '.outputs[] | select(.output_key | match("^vm_[0-9]+_ips$")) | .output_value | .[]'))
+    mapfile -t ips <<< "$(openstack stack show -f json -c outputs "$STACK_NAME" | jq -r '.outputs[] | select(.output_key | match("^vm_[0-9]+_ips$")) | .output_value | .[]')"
     for ip in "${ips[@]}"; do
         echo "Copying common-functions.sh to ${ip}:/tmp"
         scp /tmp/common-functions.sh ${ip}:/tmp