Skip to content

Commit d7d7e50

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Clean the redundant code in shell.py"
2 parents 130397a + c650450 commit d7d7e50

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

cinderclient/shell.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Copyright 2011-2014 OpenStack Foundation
32
# All Rights Reserved.
43
#
@@ -25,15 +24,12 @@
2524
import logging
2625
import sys
2726

28-
import requests
29-
import six
30-
3127
from keystoneauth1 import discover
32-
from keystoneauth1 import loading
33-
from keystoneauth1 import session
28+
from keystoneauth1 import exceptions
3429
from keystoneauth1.identity import v2 as v2_auth
3530
from keystoneauth1.identity import v3 as v3_auth
36-
from keystoneauth1.exceptions import DiscoveryFailure
31+
from keystoneauth1 import loading
32+
from keystoneauth1 import session
3733
from oslo_utils import encodeutils
3834
from oslo_utils import importutils
3935
osprofiler_profiler = importutils.try_import("osprofiler.profiler") # noqa
@@ -42,17 +38,16 @@
4238
import six.moves.urllib.parse as urlparse
4339

4440
import cinderclient
41+
from cinderclient import _i18n
42+
from cinderclient._i18n import _
4543
from cinderclient import api_versions
4644
from cinderclient import client
4745
from cinderclient import exceptions as exc
4846
from cinderclient import utils
49-
from cinderclient import _i18n
50-
from cinderclient._i18n import _
51-
52-
5347
# Enable i18n lazy translation
5448
_i18n.enable_lazy()
5549

50+
5651
DEFAULT_MAJOR_OS_VOLUME_API_VERSION = "3"
5752
DEFAULT_CINDER_ENDPOINT_TYPE = 'publicURL'
5853
V1_SHELL = 'cinderclient.v1.shell'
@@ -879,7 +874,7 @@ def _discover_auth_versions(self, session, auth_url):
879874
ks_discover = discover.Discover(session=session, url=auth_url)
880875
v2_auth_url = ks_discover.url_for('2.0')
881876
v3_auth_url = ks_discover.url_for('3.0')
882-
except DiscoveryFailure:
877+
except exceptions.DiscoveryFailure:
883878
# Discovery response mismatch. Raise the error
884879
raise
885880
except Exception:

0 commit comments

Comments
 (0)