NSX|V3: ensure that the NSX credenatials are set for devstack

Make sure that the credentials are set when spinning up a devstack
component that requires the OVS then we enforce that the NSX validations
are done.

This is necessary to determine how we configure the OVS manager.

Change-Id: Ibeec9e72ddea45b24ffde5e25b2ca8347c34bd43
This commit is contained in:
Gary Kotton 2016-09-06 02:21:18 -07:00
parent c48a13a77d
commit 7e63f047ec
1 changed files with 3 additions and 3 deletions

View File

@ -46,9 +46,6 @@ source $TOP_DIR/lib/neutron_plugins/ovs_base
function _version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
function _ovsdb_connection {
die_if_not_set $LINENO NSX_MANAGER "NSX_MANAGER has not been set!"
die_if_not_set $LINENO NSX_USER "NSX_USER has not been set!"
die_if_not_set $LINENO NSX_PASSWORD "NSX_PASSWORD has not been set!"
managers=(${NSX_MANAGER//,/ })
NSX_MGR_IP=${managers[0]}
NSX_VER=$(curl -1 -s -k -u "$NSX_USER:$NSX_PASSWORD" -H 'Accept: application/json' https://$NSX_MGR_IP/api/v1/node | python -c 'import sys, json; print json.load(sys.stdin)["node_version"][:5]')
@ -60,6 +57,9 @@ function _ovsdb_connection {
}
function setup_integration_bridge {
die_if_not_set $LINENO NSX_MANAGER "NSX_MANAGER has not been set!"
die_if_not_set $LINENO NSX_USER "NSX_USER has not been set!"
die_if_not_set $LINENO NSX_PASSWORD "NSX_PASSWORD has not been set!"
_neutron_ovs_base_setup_bridge $OVS_BRIDGE
sudo ovs-vsctl set bridge $OVS_BRIDGE external_ids:bridge-id=nsx-managed
sudo ovs-vsctl set-manager $(_ovsdb_connection)