diff options
author | Jamie Lennox <jamielennox@redhat.com> | 2014-11-25 13:25:12 +1000 |
---|---|---|
committer | Flavio Percoco <fpercoco@redhat.com> | 2015-06-11 13:11:56 +0000 |
commit | 5ce9c7dc964be0b3e8f9f273169b77ada85cd8ec (patch) | |
tree | c02ac042c63cb3f474c32bd56677d15188ea451e /glanceclient/v2/client.py | |
parent | db6420b44779411d6d1f238f6b887f83f1988986 (diff) | |
download | python-glanceclient-5ce9c7dc964be0b3e8f9f273169b77ada85cd8ec.tar.gz |
Make glanceclient accept a session object
To make this work we create a different HTTPClient that extends the
basic keystoneclient Adapter. The Adapter is a standard set of
parameters that all clients should know how to use like region_name and
user_agent. We extend this with the glance specific response
manipulation like loading and sending iterables.
Implements: bp session-objects
Change-Id: Ie8eb4bbf7d1a037099a6d4b272cab70525fbfc85
Diffstat (limited to 'glanceclient/v2/client.py')
-rw-r--r-- | glanceclient/v2/client.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/glanceclient/v2/client.py b/glanceclient/v2/client.py index 428ba61..803673b 100644 --- a/glanceclient/v2/client.py +++ b/glanceclient/v2/client.py @@ -34,11 +34,9 @@ class Client(object): http requests. (optional) """ - def __init__(self, endpoint, **kwargs): - endpoint, version = utils.strip_version(endpoint) - self.version = version or 2.0 - self.http_client = http.HTTPClient(endpoint, **kwargs) - + def __init__(self, endpoint=None, **kwargs): + endpoint, self.version = utils.endpoint_version_from_url(endpoint, 2.0) + self.http_client = http.get_http_client(endpoint=endpoint, **kwargs) self.schemas = schemas.Controller(self.http_client) self.images = images.Controller(self.http_client, self.schemas) |