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
(cherry picked from commit 3799efe792)
This commit is contained in:
Ihar Hrachyshka 2014-01-30 13:42:29 +01:00
parent 927e8a645a
commit 15a912b1ca
2 changed files with 2 additions and 2 deletions

View File

@ -80,7 +80,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
)

View 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)
]