-#!/bin/bash
+#!/bin/bash -l
+
+# shellcheck disable=SC1090
+. ~/lf-env.sh
+
+lf-activate-venv --python python3 \
+ python-heatclient \
+ python-openstackclient \
+ yq
+
# Get the Controller and Tools VM slave addresses
set -x
OPENSTACK_SYSTEM=()
OPENSTACK_CONTROLLERS=()
-OPENSTACK_VENV="/tmp/v/openstack"
-# shellcheck source=/tmp/v/openstack/bin/activate disable=SC1091
-source $OPENSTACK_VENV/bin/activate
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
ctrl_index=$((ctrl_index -1))
tmp_addr=${OPENSTACK_SYSTEM[0]}
OPENSTACK_SYSTEM[0]=${OPENSTACK_SYSTEM[$ctrl_index]}
- OPENSTACK_SYSTEM[$ctrl_index]=$tmp_addr
+ OPENSTACK_SYSTEM[ctrl_index]=$tmp_addr
fi
# Add alias for ODL_SYSTEM_1_IP as ODL_SYSTEM_IP