summaryrefslogtreecommitdiff
path: root/barbicanclient/client.py
diff options
context:
space:
mode:
authorJuan Antonio Osorio Robles <juan.osorio.robles@ericsson.com>2015-05-20 03:50:29 +0300
committerJuan Antonio Osorio Robles <juan.osorio.robles@ericsson.com>2015-05-20 19:44:38 +0300
commit240c5812678400ab4b823b1e2f8bff7a8a55cb48 (patch)
treea6dd40eb4ac774d5bd6a9390ece8ba953cb4b3eb /barbicanclient/client.py
parent4c4b8e8025cd4012d5bf7879061b63d9e13e2f4f (diff)
downloadpython-barbicanclient-240c5812678400ab4b823b1e2f8bff7a8a55cb48.tar.gz
Add capability of specifying Barbican version to client
While specifying the version of the Barbican API was possible before, this was being ignored on the client and the default version was always hardcoded. This CR now takes that into account and will append the version to the base endpoint. Change-Id: I2bd8bf64792dd91d7b79709398840c0c2d07a69d
Diffstat (limited to 'barbicanclient/client.py')
-rw-r--r--barbicanclient/client.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/barbicanclient/client.py b/barbicanclient/client.py
index 939f8fb..7f0a6b2 100644
--- a/barbicanclient/client.py
+++ b/barbicanclient/client.py
@@ -38,15 +38,19 @@ class _HTTPClient(adapter.Adapter):
def __init__(self, session, project_id=None, **kwargs):
kwargs.setdefault('interface', _DEFAULT_SERVICE_INTERFACE)
kwargs.setdefault('service_type', _DEFAULT_SERVICE_TYPE)
+ kwargs.setdefault('version', _DEFAULT_API_VERSION)
endpoint = kwargs.pop('endpoint', None)
super(_HTTPClient, self).__init__(session, **kwargs)
if not endpoint:
endpoint = self.get_endpoint()
+ # NOTE(jaosorior): We are manually appending the given version. This
+ # could be filled automatically by keystoneclient; but
+ # we need the fix-version-api blueprint to land in the
+ # server first.
+ self.endpoint_override = '{0}/{1}'.format(endpoint, self.version)
- self.endpoint_override = '{0}/{1}'.format(endpoint,
- _DEFAULT_API_VERSION)
if project_id is None:
self._default_headers = dict()
else: