Use mapfile for array 98/67898/1
authorSam Hague <shague@redhat.com>
Sun, 4 Feb 2018 15:42:52 +0000 (10:42 -0500)
committerSam Hague <shague@redhat.com>
Sun, 4 Feb 2018 15:42:52 +0000 (10:42 -0500)
Change-Id: Id62d1c8d0967ffc07bd6361aabb28789a9750c6d
Signed-off-by: Sam Hague <shague@redhat.com>
jjb/integration/integration-get-slave-addresses.sh

index 4356f5721c84d8625b5ba55cdadf3733a209ac0a..816dcf80a72515593df804d1510abcee0bdac5a8 100644 (file)
@@ -12,9 +12,7 @@ OPENSTACK_CONTROLLERS=()
 OPENSTACK_VENV="/tmp/v/openstack"
 # shellcheck source=/tmp/v/openstack/bin/activate disable=SC1091
 source $OPENSTACK_VENV/bin/activate
-# shellcheck disable=SC2207
-ADDR=($(openstack stack show -f json -c outputs "$STACK_NAME" | \
-       jq -r '.outputs[] | select(.output_key | match("^vm_[0-9]+_ips$")) | .output_value | .[]'))
+mapfile -t ADDR <<< "$(openstack stack show -f json -c outputs "$STACK_NAME" | jq -r '.outputs[] | select(.output_key | match("^vm_[0-9]+_ips$")) | .output_value | .[]')"
 
 # The next two blocks of code will parse the list of vm IP's hostnames to determine which type of node
 # the vm is: odl, devstack controller or compute, ha_proxy or tools. For the odl node's the hsotname will contain