From 007b9e4b6043ce329a8c073cf29fbf6091c07012 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Thu, 30 Jan 2014 13:42:29 +0100 Subject: [PATCH] Fix passing keystone token to neutronclient instance 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 | 2 +- neutron/tests/unit/test_metadata_agent.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/neutron/agent/metadata/agent.py b/neutron/agent/metadata/agent.py index c8d618739..ce2751630 100644 --- a/neutron/agent/metadata/agent.py +++ b/neutron/agent/metadata/agent.py @@ -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 ) diff --git a/neutron/tests/unit/test_metadata_agent.py b/neutron/tests/unit/test_metadata_agent.py index 7b5fab2c1..b1ef07f1b 100644 --- a/neutron/tests/unit/test_metadata_agent.py +++ b/neutron/tests/unit/test_metadata_agent.py @@ -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) ] -- 2.45.2