Allow specification of endpoint_type to clients
We currently do not allow operators to specify which endpoint type needs to be used to reach nova and neutron via their clients. This adds a new option that defaults to publicURL (as it is today) but allows operators to specify internalURL or adminURL if they need. Change-Id: I9432b4df8a5b4fc9f0cc06e6ffb662df634ec4f8 Closes-bug: #1572693
This commit is contained in:
parent
cea4c6713a
commit
b305beacd4
|
@ -28,5 +28,6 @@ api_opts = [
|
||||||
cfg.StrOpt('auth_region'),
|
cfg.StrOpt('auth_region'),
|
||||||
cfg.IntOpt('max_retries', default=3),
|
cfg.IntOpt('max_retries', default=3),
|
||||||
cfg.IntOpt('retry_delay', default=1),
|
cfg.IntOpt('retry_delay', default=1),
|
||||||
|
cfg.StrOpt('endpoint_type', default='publicURL'),
|
||||||
]
|
]
|
||||||
CONF.register_opts(api_opts)
|
CONF.register_opts(api_opts)
|
||||||
|
|
|
@ -791,6 +791,7 @@ class Neutron(object):
|
||||||
ks_session = keystone.KeystoneSession()
|
ks_session = keystone.KeystoneSession()
|
||||||
self.api_client = AstaraExtClientWrapper(
|
self.api_client = AstaraExtClientWrapper(
|
||||||
session=ks_session.session,
|
session=ks_session.session,
|
||||||
|
endpoint_type=cfg.CONF.endpoint_type,
|
||||||
)
|
)
|
||||||
self.l3_rpc_client = L3PluginApi(PLUGIN_ROUTER_RPC_TOPIC,
|
self.l3_rpc_client = L3PluginApi(PLUGIN_ROUTER_RPC_TOPIC,
|
||||||
cfg.CONF.host)
|
cfg.CONF.host)
|
||||||
|
|
|
@ -249,7 +249,8 @@ class Nova(object):
|
||||||
self.client = client.Client(
|
self.client = client.Client(
|
||||||
version='2',
|
version='2',
|
||||||
session=ks_session.session,
|
session=ks_session.session,
|
||||||
region_name=conf.auth_region)
|
region_name=conf.auth_region,
|
||||||
|
endpoint_type=conf.endpoint_type)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.instance_provider = get_instance_provider(
|
self.instance_provider = get_instance_provider(
|
||||||
|
|
|
@ -84,6 +84,7 @@ class FakeConf:
|
||||||
router_image_uuid = 'astara-image'
|
router_image_uuid = 'astara-image'
|
||||||
router_instance_flavor = 1
|
router_instance_flavor = 1
|
||||||
instance_provider = 'foo'
|
instance_provider = 'foo'
|
||||||
|
endpoint_type = 'publicURL'
|
||||||
|
|
||||||
|
|
||||||
EXPECTED_USERDATA = """
|
EXPECTED_USERDATA = """
|
||||||
|
|
Loading…
Reference in New Issue