]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix passing keystone token to neutronclient instance
authorIhar Hrachyshka <ihrachys@redhat.com>
Thu, 30 Jan 2014 12:42:29 +0000 (13:42 +0100)
committerGerrit Code Review <review@openstack.org>
Thu, 6 Feb 2014 12:38:53 +0000 (12:38 +0000)
Neutron client expects token to be passed as token= argument, while
neutron-metadata-agent passes auth_token= instead. This effectively makes the
client to authenticate against keystone each time it's instantiated. In
neutron-metadata-agent case, it means 'each time a client sends a metadata
request.'

The issue results in high cpu utilization on keystone side when simultaneously
invoking multiple nova instances with cloud-init.

Change-Id: I2a31f9c0c3cfa915975ecc53d71168a3895528d8
Closes-Bug: 1274487

neutron/agent/metadata/agent.py
neutron/tests/unit/test_metadata_agent.py

index c8d61873917ad2d80ce71060e6e223eef9bcf92d..ce275163067ebf8c646bdb1ab1ee30f816c9f311 100644 (file)
@@ -87,7 +87,7 @@ class MetadataProxyHandler(object):
             auth_url=self.conf.auth_url,
             auth_strategy=self.conf.auth_strategy,
             region_name=self.conf.auth_region,
-            auth_token=self.auth_info.get('auth_token'),
+            token=self.auth_info.get('auth_token'),
             endpoint_url=self.auth_info.get('endpoint_url'),
             endpoint_type=self.conf.endpoint_type
         )
index 7b5fab2c1367ba2014c2ae5cc3ed7ff667f2985b..b1ef07f1b72f6aa18a1e49f214aa113b32b1ca35 100644 (file)
@@ -99,7 +99,7 @@ class TestMetadataProxyHandler(base.BaseTestCase):
                 auth_url=FakeConf.auth_url,
                 password=FakeConf.admin_password,
                 auth_strategy=FakeConf.auth_strategy,
-                auth_token=None,
+                token=None,
                 endpoint_url=None,
                 endpoint_type=FakeConf.endpoint_type)
         ]