Make endpoint_type configurable for the metadata agent

Fixes bug 1176227

Change-Id: Ib4efe29a08efb7ec391d6b16779b27aeb9178324
This commit is contained in:
Oleg Bondarev 2013-05-14 16:32:21 +04:00
parent df6109ae70
commit a7441a4f0e
3 changed files with 11 additions and 1 deletions

View File

@ -9,6 +9,9 @@ admin_tenant_name = %SERVICE_TENANT_NAME%
admin_user = %SERVICE_USER%
admin_password = %SERVICE_PASSWORD%
# Network service endpoint type to pull from the keystone catalog
# endpoint_type = adminURL
# IP address used by Nova metadata server
# nova_metadata_ip = 127.0.0.1

View File

@ -53,6 +53,10 @@ class MetadataProxyHandler(object):
help=_("The type of authentication to use")),
cfg.StrOpt('auth_region',
help=_("Authentication region")),
cfg.StrOpt('endpoint_type',
default='adminURL',
help=_("Network service endpoint type to pull from "
"the keystone catalog")),
cfg.StrOpt('nova_metadata_ip', default='127.0.0.1',
help=_("IP address used by Nova metadata server.")),
cfg.IntOpt('nova_metadata_port',
@ -78,6 +82,7 @@ class MetadataProxyHandler(object):
region_name=self.conf.auth_region,
auth_token=self.auth_info.get('auth_token'),
endpoint_url=self.auth_info.get('endpoint_url'),
endpoint_type=self.conf.endpoint_type
)
return qclient

View File

@ -34,6 +34,7 @@ class FakeConf(object):
auth_url = 'http://127.0.0.1'
auth_strategy = 'keystone'
auth_region = 'region'
endpoint_type = 'adminURL'
nova_metadata_ip = '9.9.9.9'
nova_metadata_port = 8775
metadata_proxy_shared_secret = 'secret'
@ -97,7 +98,8 @@ class TestMetadataProxyHandler(base.BaseTestCase):
password=FakeConf.admin_password,
auth_strategy=FakeConf.auth_strategy,
auth_token=None,
endpoint_url=None)
endpoint_url=None,
endpoint_type=FakeConf.endpoint_type)
]
if router_id: