]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Make endpoint_type configurable for the metadata agent
authorOleg Bondarev <obondarev@mirantis.com>
Tue, 14 May 2013 12:32:21 +0000 (16:32 +0400)
committerOleg Bondarev <obondarev@mirantis.com>
Tue, 21 May 2013 10:11:13 +0000 (14:11 +0400)
Fixes bug 1176227

Change-Id: Ib4efe29a08efb7ec391d6b16779b27aeb9178324

etc/metadata_agent.ini
quantum/agent/metadata/agent.py
quantum/tests/unit/test_metadata_agent.py

index 2a4e1ac55e236b71001667604840c205375955a8..45294927a14f5ae8383f34456bc15e7cc42c236b 100644 (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
 
index 9e37251d1d41dc5b9bbaad2874d1394ba8f283f5..dfdd52c97d66f5c5725b2edba34d5c34c6cd906f 100644 (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
 
index c50543ff8fbccca517e2169718018034bb189d28..15ad8b5987473d321081c9c127d9e2a08de42576 100644 (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: