From c126a2ae5665de05dbdd26eb5d6ed16a08d78781 Mon Sep 17 00:00:00 2001 From: Roxana Gherle <roxana.gherle@hp.com> Date: Mon, 11 May 2015 16:48:21 -0700 Subject: [PATCH] Send the correct user-agent to Keystone When we execute an Openstack CLI command, keystone should log in Keystone access log that the user-agent that made the request was 'python-openstackclient' instead of the default 'python-keystoneclient'. Therefore, when we create the authentication session we need to send the explicit user-agent. Closes-Bug: #1453995 Change-Id: I75087fd4bb1ff1e6f2a911bc70bf8008268276bb --- openstackclient/common/clientmanager.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openstackclient/common/clientmanager.py b/openstackclient/common/clientmanager.py index ca5ece0d75..85e367c41c 100644 --- a/openstackclient/common/clientmanager.py +++ b/openstackclient/common/clientmanager.py @@ -30,6 +30,8 @@ LOG = logging.getLogger(__name__) PLUGIN_MODULES = [] +USER_AGENT = 'python-openstackclient' + class ClientCache(object): """Descriptor class for caching created client handles.""" @@ -163,6 +165,7 @@ class ClientManager(object): auth=self.auth, session=request_session, verify=self._verify, + user_agent=USER_AGENT, ) return