Set VIRSH_DEFAULT_CONNECT_URI in Ironic scripts
Ironic setup scripts that interface with virsh should default to always
connecting to the 'qemu:///system' URI. Adds LIBVIRT_CONNECT_URI that
ends up exported as VIRSH_DEFAULT_CONNECT_URI in scripts that require
it.
Change-Id: Ib660bd51a8c7bfe96e14aab4b6d3a6e83a5a4220
diff --git a/tools/ironic/scripts/setup-network b/tools/ironic/scripts/setup-network
index 8c3ea90..e326bf8 100755
--- a/tools/ironic/scripts/setup-network
+++ b/tools/ironic/scripts/setup-network
@@ -7,11 +7,15 @@
set -exu
+LIBVIRT_CONNECT_URI=${LIBVIRT_CONNECT_URI:-"qemu:///system"}
+
# Keep track of the devstack directory
TOP_DIR=$(cd $(dirname "$0")/.. && pwd)
BRIDGE_SUFFIX=${1:-''}
BRIDGE_NAME=brbm$BRIDGE_SUFFIX
+export VIRSH_DEFAULT_CONNECT_URI="$LIBVIRT_CONNECT_URI"
+
# Only add bridge if missing
(sudo ovs-vsctl list-br | grep ${BRIDGE_NAME}$) || sudo ovs-vsctl add-br ${BRIDGE_NAME}