NSX|P: Use nsx_p certificate configuration
When initializing the NSX policy connection, the nsx_p configuration should be used for the certificate parameters. Change-Id: I2a103930d2a378b267a3cc7320cdd2f37a59a1bb
This commit is contained in:
parent
759f015542
commit
4edec4ab9b
@ -121,17 +121,17 @@ class DbCertProvider(client_cert.ClientCertProvider):
|
|||||||
return self._filename
|
return self._filename
|
||||||
|
|
||||||
|
|
||||||
def get_client_cert_provider():
|
def get_client_cert_provider(conf_path=cfg.CONF.nsx_v3):
|
||||||
if not cfg.CONF.nsx_v3.nsx_use_client_auth:
|
if not conf_path.nsx_use_client_auth:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if cfg.CONF.nsx_v3.nsx_client_cert_storage.lower() == 'none':
|
if conf_path.nsx_client_cert_storage.lower() == 'none':
|
||||||
# Admin is responsible for providing cert file, the plugin
|
# Admin is responsible for providing cert file, the plugin
|
||||||
# should not touch it
|
# should not touch it
|
||||||
return client_cert.ClientCertProvider(
|
return client_cert.ClientCertProvider(
|
||||||
cfg.CONF.nsx_v3.nsx_client_cert_file)
|
conf_path.nsx_client_cert_file)
|
||||||
|
|
||||||
if cfg.CONF.nsx_v3.nsx_client_cert_storage.lower() == 'nsx-db':
|
if conf_path.nsx_client_cert_storage.lower() == 'nsx-db':
|
||||||
# Cert data is stored in DB, and written to file system only
|
# Cert data is stored in DB, and written to file system only
|
||||||
# when new connection is opened, and deleted immediately after.
|
# when new connection is opened, and deleted immediately after.
|
||||||
return DbCertProvider
|
return DbCertProvider
|
||||||
@ -171,7 +171,8 @@ def get_nsxpolicy_wrapper(nsx_username=None, nsx_password=None,
|
|||||||
client_cert_provider = None
|
client_cert_provider = None
|
||||||
if not basic_auth:
|
if not basic_auth:
|
||||||
# if basic auth requested, dont use cert file even if provided
|
# if basic auth requested, dont use cert file even if provided
|
||||||
client_cert_provider = get_client_cert_provider()
|
client_cert_provider = get_client_cert_provider(
|
||||||
|
conf_path=cfg.CONF.nsx_p)
|
||||||
|
|
||||||
nsxlib_config = config.NsxLibConfig(
|
nsxlib_config = config.NsxLibConfig(
|
||||||
username=nsx_username or cfg.CONF.nsx_p.nsx_api_user,
|
username=nsx_username or cfg.CONF.nsx_p.nsx_api_user,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user