diff options
| author | Shao Kai Li <lshaokai@cn.ibm.com> | 2014-02-19 00:34:30 -0500 |
|---|---|---|
| committer | Shao Kai Li <lshaokai@cn.ibm.com> | 2014-03-03 01:16:26 -0500 |
| commit | 1b0ea8768c9e1368e978a45b1bba125cd81e9b59 (patch) | |
| tree | badc7bc03fcba3b0b14d5dcb30ec8179aa9a1b50 /cinderclient/client.py | |
| parent | 3ec28c3309d28d99a10ab1e1b55fd360fd2a97b5 (diff) | |
| download | python-cinderclient-1b0ea8768c9e1368e978a45b1bba125cd81e9b59.tar.gz | |
Import access module from keystoneclient to handle V3 endpoints
* service_catalog.py will be used only by nova(cinder.py), it will be removed if nova
uses access instead of service_catalog. Then service_catalog.py and
test_service_catalog.py will be removed from cinderclient if necessary.
* Some unit tests are modified.
* Because of JSON format's modification, functions that process cinder
credentials and cinder endpoints are changed.
* Add dependency for keystoneclient in requirements.txt.
Change-Id: Icf7badfdddcf5f55536d95db7242aff58aa34b6e
Closes-Bug: #1263876
bp: service-catalog
Diffstat (limited to 'cinderclient/client.py')
| -rw-r--r-- | cinderclient/client.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/cinderclient/client.py b/cinderclient/client.py index c268137..314c852 100644 --- a/cinderclient/client.py +++ b/cinderclient/client.py @@ -45,8 +45,9 @@ if not hasattr(urlparse, 'parse_qsl'): import requests +from keystoneclient import access + from cinderclient import exceptions -from cinderclient import service_catalog from cinderclient import utils @@ -223,19 +224,17 @@ class HTTPClient(object): if resp.status_code == 200: # content must always present try: self.auth_url = url - self.service_catalog = \ - service_catalog.ServiceCatalog(body) + self.auth_ref = access.AccessInfo.factory(resp, body) + self.service_catalog = self.auth_ref.service_catalog if extract_token: - self.auth_token = self.service_catalog.get_token() + self.auth_token = self.auth_ref.auth_token management_url = self.service_catalog.url_for( attr='region', filter_value=self.region_name, endpoint_type=self.endpoint_type, - service_type=self.service_type, - service_name=self.service_name, - volume_service_name=self.volume_service_name) + service_type=self.service_type) self.management_url = management_url.rstrip('/') return None except exceptions.AmbiguousEndpoints: |
