X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=jjb%2Fintegration%2Fintegration-get-slave-addresses.sh;h=816dcf80a72515593df804d1510abcee0bdac5a8;hb=12835ee13cc548d31c830f6f1c8a1b4ec13bc297;hp=8f01f54dbd9467a8bdf307f9d698c0a329926e44;hpb=6f0850aa18c3a58aaac9a37e21f71f63651eaef1;p=releng%2Fbuilder.git diff --git a/jjb/integration/integration-get-slave-addresses.sh b/jjb/integration/integration-get-slave-addresses.sh index 8f01f54db..816dcf80a 100644 --- a/jjb/integration/integration-get-slave-addresses.sh +++ b/jjb/integration/integration-get-slave-addresses.sh @@ -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 @@ -103,6 +101,15 @@ done # The rest of the openstack nodes until NUM_OPENSTACK_SYSTEM are computes NUM_OPENSTACK_COMPUTE_NODES=$(( NUM_OPENSTACK_SYSTEM - NUM_OPENSTACK_CONTROL_NODES )) echo "NUM_OPENSTACK_COMPUTE_NODES=${NUM_OPENSTACK_COMPUTE_NODES}" >> slave_addresses.txt + +# Order the computes in the list so that the devstack-0 is index 1 and devstack-1 is index 2. Currently they are +# backwards because of the controller swap earlier. +if [ ${NUM_OPENSTACK_COMPUTE_NODES} -ge 2 ]; then + tmp_addr=${OPENSTACK_SYSTEM[1]} + OPENSTACK_SYSTEM[1]=${OPENSTACK_SYSTEM[2]} + OPENSTACK_SYSTEM[2]=${tmp_addr} +fi + for i in $(seq 0 $((NUM_OPENSTACK_COMPUTE_NODES - 1))) do echo "OPENSTACK_COMPUTE_NODE_$((i+1))_IP=${OPENSTACK_SYSTEM[$((openstack_index++))]}" >> slave_addresses.txt