NSX|V3: improve configuration names

The configuration names nsx_* have been changed to nsx_api_*.
This better refelect the configuration and management of the NSX API
service.

Change-Id: I999f56efad1b413bc677a9de8b535f3f4785e4f5
Closes-bug: #1524659
This commit is contained in:
Gary Kotton 2015-12-10 00:51:55 -08:00
parent 38612eca2a
commit 696b712ad4
7 changed files with 24 additions and 22 deletions

View File

@ -100,9 +100,9 @@ function neutron_plugin_configure_service {
fi
# NSX_MANAGER must be a comma separated string
if [[ "$NSX_MANAGERS" != "" ]]; then
_nsxv3_ini_set nsx_managers $NSX_MANAGERS
_nsxv3_ini_set nsx_api_managers $NSX_MANAGERS
elif [[ "$NSX_MANAGER" != "" ]]; then
_nsxv3_ini_set nsx_managers $NSX_MANAGER
_nsxv3_ini_set nsx_api_managers $NSX_MANAGER
else
die $LINENO "The VMware NSX plugin needs at least one NSX manager."
fi
@ -110,8 +110,8 @@ function neutron_plugin_configure_service {
iniset /$Q_PLUGIN_CONF_FILE DEFAULT nsx_l2gw_driver $NSX_L2GW_DRIVER
fi
_nsxv3_ini_set default_tier0_router_uuid $DEFAULT_TIER0_ROUTER_UUID
_nsxv3_ini_set nsx_user $NSX_USER
_nsxv3_ini_set nsx_password $NSX_PASSWORD
_nsxv3_ini_set nsx_api_user $NSX_USER
_nsxv3_ini_set nsx_api_password $NSX_PASSWORD
_nsxv3_ini_set retries $NSX_RETRIES
_nsxv3_ini_set insecure $NSX_INSECURE
_nsxv3_ini_set ca_file $NSX_CA_FILE

View File

@ -320,13 +320,13 @@
# [<scheme>://]<ip_adress>[:<port>]
# If scheme is not provided https is used. If port is not provided
# port 80 is used for http and port 443 for https.
# nsx_managers = 1.2.3.4
# nsx_api_managers = 1.2.3.4
# User name of NSX Manager
# nsx_user = admin
# nsx_api_user = admin
# Password of NSX Manager
# nsx_password = default
# nsx_api_password = default
# UUID of the default NSX overlay transport zone that will be used for creating
# tunneled isolated Neutron networks

View File

@ -169,14 +169,16 @@ nsx_common_opts = [
]
nsx_v3_opts = [
cfg.StrOpt('nsx_user',
cfg.StrOpt('nsx_api_user',
deprecated_name='nsx_user',
default='admin',
help=_('User name for the NSX manager')),
cfg.StrOpt('nsx_password',
cfg.StrOpt('nsx_api_password',
deprecated_name='nsx_password',
default='default',
secret=True,
help=_('Password for the NSX manager')),
cfg.ListOpt('nsx_managers',
cfg.ListOpt('nsx_api_managers',
deprecated_name='nsx_manager',
help=_('IP address of one or more NSX managers separated '
'by commas. The IP address can optionally specify a '

View File

@ -208,7 +208,7 @@ def _get_client(client):
# NOTE(shihli): tmp until all refs use client class
def _get_nsx_managers_from_conf():
return cfg.CONF.nsx_v3.nsx_managers
return cfg.CONF.nsx_v3.nsx_api_managers
def get_resource(resource, client=None):

View File

@ -433,8 +433,8 @@ class NSXClusteredAPI(ClusteredAPI):
http_timeout=None,
conn_idle_timeout=None,
http_provider=None):
self.username = username or cfg.CONF.nsx_v3.nsx_user
self.password = password or cfg.CONF.nsx_v3.nsx_password
self.username = username or cfg.CONF.nsx_v3.nsx_api_user
self.password = password or cfg.CONF.nsx_v3.nsx_api_password
self.retries = retries or cfg.CONF.nsx_v3.retries
self.insecure = insecure or cfg.CONF.nsx_v3.insecure
self.ca_file = ca_file or cfg.CONF.nsx_v3.ca_file
@ -463,7 +463,7 @@ class NSXClusteredAPI(ClusteredAPI):
uri if uri.startswith('http') else
"%s://%s" % (self._http_provider.default_scheme, uri))
conf_urls = cfg.CONF.nsx_v3.nsx_managers[:]
conf_urls = cfg.CONF.nsx_v3.nsx_api_managers[:]
urls = []
providers = []

View File

@ -39,9 +39,9 @@ class NsxLibTestCase(unittest.TestCase):
def setup_conf_overrides(cls):
cfg.CONF.set_override('default_overlay_tz_uuid',
uuidutils.generate_uuid(), 'nsx_v3')
cfg.CONF.set_override('nsx_user', NSX_USER, 'nsx_v3')
cfg.CONF.set_override('nsx_password', NSX_PASSWORD, 'nsx_v3')
cfg.CONF.set_override('nsx_managers', [NSX_MANAGER], 'nsx_v3')
cfg.CONF.set_override('nsx_api_user', NSX_USER, 'nsx_v3')
cfg.CONF.set_override('nsx_api_password', NSX_PASSWORD, 'nsx_v3')
cfg.CONF.set_override('nsx_api_managers', [NSX_MANAGER], 'nsx_v3')
cfg.CONF.set_override('insecure', NSX_INSECURE, 'nsx_v3')
cfg.CONF.set_override('ca_file', NSX_CERT, 'nsx_v3')

View File

@ -86,7 +86,7 @@ class NsxV3ClusteredAPITestCase(nsxlib_testcase.NsxClientTestCase):
def test_conf_providers_no_scheme(self):
conf_managers = ['8.9.10.11', '9.10.11.12:4433']
cfg.CONF.set_override(
'nsx_managers', conf_managers, 'nsx_v3')
'nsx_api_managers', conf_managers, 'nsx_v3')
mock_provider = mock.Mock()
mock_provider.default_scheme = 'https'
@ -100,7 +100,7 @@ class NsxV3ClusteredAPITestCase(nsxlib_testcase.NsxClientTestCase):
def test_conf_providers_with_scheme(self):
conf_managers = ['http://8.9.10.11:8080', 'https://9.10.11.12:4433']
cfg.CONF.set_override(
'nsx_managers', conf_managers, 'nsx_v3')
'nsx_api_managers', conf_managers, 'nsx_v3')
mock_provider = mock.Mock()
mock_provider.default_scheme = 'https'
@ -116,7 +116,7 @@ class NsxV3ClusteredAPITestCase(nsxlib_testcase.NsxClientTestCase):
'concurrent_connections', 11, 'nsx_v3')
conf_managers = ['8.9.10.11', '9.10.11.12:4433']
cfg.CONF.set_override(
'nsx_managers', conf_managers, 'nsx_v3')
'nsx_api_managers', conf_managers, 'nsx_v3')
mock_provider = mock.Mock()
mock_provider.default_scheme = 'https'
@ -133,7 +133,7 @@ class ClusteredAPITestCase(nsxlib_testcase.NsxClientTestCase):
def _test_health(self, validate_fn, expected_health):
conf_managers = ['8.9.10.11', '9.10.11.12']
cfg.CONF.set_override(
'nsx_managers', conf_managers, 'nsx_v3')
'nsx_api_managers', conf_managers, 'nsx_v3')
mock_provider = mock.Mock()
mock_provider.default_scheme = 'https'
@ -159,7 +159,7 @@ class ClusteredAPITestCase(nsxlib_testcase.NsxClientTestCase):
def test_cluster_unavailable(self):
conf_managers = ['8.9.10.11', '9.10.11.12', '10.11.12.13']
cfg.CONF.set_override(
'nsx_managers', conf_managers, 'nsx_v3')
'nsx_api_managers', conf_managers, 'nsx_v3')
mock_provider = mock.Mock()
mock_provider.default_scheme = 'https'