|
1 | | - |
2 | 1 | # Copyright 2011-2014 OpenStack Foundation |
3 | 2 | # All Rights Reserved. |
4 | 3 | # |
|
25 | 24 | import logging |
26 | 25 | import sys |
27 | 26 |
|
28 | | -import requests |
29 | | -import six |
30 | | - |
31 | 27 | from keystoneauth1 import discover |
32 | | -from keystoneauth1 import loading |
33 | | -from keystoneauth1 import session |
| 28 | +from keystoneauth1 import exceptions |
34 | 29 | from keystoneauth1.identity import v2 as v2_auth |
35 | 30 | from keystoneauth1.identity import v3 as v3_auth |
36 | | -from keystoneauth1.exceptions import DiscoveryFailure |
| 31 | +from keystoneauth1 import loading |
| 32 | +from keystoneauth1 import session |
37 | 33 | from oslo_utils import encodeutils |
38 | 34 | from oslo_utils import importutils |
39 | 35 | osprofiler_profiler = importutils.try_import("osprofiler.profiler") # noqa |
|
42 | 38 | import six.moves.urllib.parse as urlparse |
43 | 39 |
|
44 | 40 | import cinderclient |
| 41 | +from cinderclient import _i18n |
| 42 | +from cinderclient._i18n import _ |
45 | 43 | from cinderclient import api_versions |
46 | 44 | from cinderclient import client |
47 | 45 | from cinderclient import exceptions as exc |
48 | 46 | from cinderclient import utils |
49 | | -from cinderclient import _i18n |
50 | | -from cinderclient._i18n import _ |
51 | | - |
52 | | - |
53 | 47 | # Enable i18n lazy translation |
54 | 48 | _i18n.enable_lazy() |
55 | 49 |
|
| 50 | + |
56 | 51 | DEFAULT_MAJOR_OS_VOLUME_API_VERSION = "3" |
57 | 52 | DEFAULT_CINDER_ENDPOINT_TYPE = 'publicURL' |
58 | 53 | V1_SHELL = 'cinderclient.v1.shell' |
@@ -877,7 +872,7 @@ def _discover_auth_versions(self, session, auth_url): |
877 | 872 | ks_discover = discover.Discover(session=session, url=auth_url) |
878 | 873 | v2_auth_url = ks_discover.url_for('2.0') |
879 | 874 | v3_auth_url = ks_discover.url_for('3.0') |
880 | | - except DiscoveryFailure: |
| 875 | + except exceptions.DiscoveryFailure: |
881 | 876 | # Discovery response mismatch. Raise the error |
882 | 877 | raise |
883 | 878 | except Exception: |
|
0 commit comments