Merge "Add git-review to base system"
[releng/builder.git] / jjb / integration / include-raw-integration-get-slave-addresses.sh
index 32be449b88ec751d692564ad54d61061504e2e69..293f23658dedca2cffc0af8fe34da66295b0f2ec 100644 (file)
@@ -4,9 +4,18 @@ ODL_SYSTEM=()
 TOOLS_SYSTEM=()
 OPENSTACK_SYSTEM=()
 
-echo "JCLOUDS IPS are ${JCLOUDS_IPS}"
-
-IFS=',' read -ra ADDR <<< "${JCLOUDS_IPS}"
+# TODO: Remove condition when we no longer use JClouds plugin
+if [ -z "$JCLOUDS_IPS" ]; then
+    # If JCLOUDS_IPS is not set then we will spawn instances with
+    # OpenStack Heat.
+    source $WORKSPACE/.venv-openstack/bin/activate
+    CONTROLLER_IPS=`openstack --os-cloud rackspace stack show -f json -c outputs $STACK_NAME | jq -r '.outputs[] | select(.output_key=="vm_0_ips") | .output_value[]'`
+    MININET_IPS=`openstack --os-cloud rackspace stack show -f json -c outputs $STACK_NAME | jq -r '.outputs[] | select(.output_key=="vm_1_ips") | .output_value[]'`
+    ADDR=($CONTROLLER_IPS $MININET_IPS)
+else
+    echo "OpenStack IPS are ${JCLOUDS_IPS}"
+    IFS=',' read -ra ADDR <<< "${JCLOUDS_IPS}"
+fi
 
 for i in "${ADDR[@]}"
 do
@@ -53,4 +62,3 @@ do
     echo "OPENSTACK_COMPUTE_NODE_$((i))_IP=${OPENSTACK_SYSTEM[${i}]}" >> slave_addresses.txt
 done
 # vim: sw=4 ts=4 sts=4 et ft=sh :
-