Arrange compute nodes in hostname order 66/67166/4
authorSam Hague <shague@redhat.com>
Fri, 12 Jan 2018 23:43:48 +0000 (18:43 -0500)
committerSam Hague <shague@redhat.com>
Tue, 16 Jan 2018 18:08:09 +0000 (13:08 -0500)
The below is how a current job looks. Notice the CMP2_HOSTNAME with -0
maps to COMPUTE_2_IP and smae for the other vm. So we swap the
two HOSTNAME's and then they align with what is passed to pybot.
Without this, mentally when looking at debugs, you have to remember
to swap the two.

OS_CMP1_HOSTNAME: releng-17212-771-2-devstack-ocata-1.vexxhost.net -
OS_CMP1_IP: 10.30.170.121 - OS_COMPUTE_1_IP: 10.30.170.121
OS_CMP2_HOSTNAME: releng-17212-771-2-devstack-ocata-0.vexxhost.net -
OS_CMP2_IP: 10.30.170.13 - OS_COMPUTE_2_IP: 10.30.170.13

Change-Id: Ifab24ca30c24523f35591517338af7e9946d072e
Signed-off-by: Sam Hague <shague@redhat.com>
jjb/integration/integration-get-slave-addresses.sh

index 8f01f54dbd9467a8bdf307f9d698c0a329926e44..4356f5721c84d8625b5ba55cdadf3733a209ac0a 100644 (file)
@@ -103,6 +103,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