summaryrefslogtreecommitdiff
path: root/cinderclient/shell.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-08-01 19:14:16 +0000
committerGerrit Code Review <review@openstack.org>2017-08-01 19:14:16 +0000
commitd7d7e50126eecfb0d526bfb65caf04a2b05af7c5 (patch)
tree633c8055484b0a2d061aee15f8b89a8d915b3c36 /cinderclient/shell.py
parent130397a12870c6c9495c0da477b93b59ba628dbb (diff)
parentc6504502edcda34c624af4f3c5e1765c664f408e (diff)
downloadpython-cinderclient-d7d7e50126eecfb0d526bfb65caf04a2b05af7c5.tar.gz
Merge "Clean the redundant code in shell.py"
Diffstat (limited to 'cinderclient/shell.py')
-rw-r--r--cinderclient/shell.py19
1 files changed, 7 insertions, 12 deletions
diff --git a/cinderclient/shell.py b/cinderclient/shell.py
index 6d2a835..536ec3c 100644
--- a/cinderclient/shell.py
+++ b/cinderclient/shell.py
@@ -1,4 +1,3 @@
-
# Copyright 2011-2014 OpenStack Foundation
# All Rights Reserved.
#
@@ -25,15 +24,12 @@ import getpass
import logging
import sys
-import requests
-import six
-
from keystoneauth1 import discover
-from keystoneauth1 import loading
-from keystoneauth1 import session
+from keystoneauth1 import exceptions
from keystoneauth1.identity import v2 as v2_auth
from keystoneauth1.identity import v3 as v3_auth
-from keystoneauth1.exceptions import DiscoveryFailure
+from keystoneauth1 import loading
+from keystoneauth1 import session
from oslo_utils import encodeutils
from oslo_utils import importutils
osprofiler_profiler = importutils.try_import("osprofiler.profiler") # noqa
@@ -42,17 +38,16 @@ import six
import six.moves.urllib.parse as urlparse
import cinderclient
+from cinderclient import _i18n
+from cinderclient._i18n import _
from cinderclient import api_versions
from cinderclient import client
from cinderclient import exceptions as exc
from cinderclient import utils
-from cinderclient import _i18n
-from cinderclient._i18n import _
-
-
# Enable i18n lazy translation
_i18n.enable_lazy()
+
DEFAULT_MAJOR_OS_VOLUME_API_VERSION = "3"
DEFAULT_CINDER_ENDPOINT_TYPE = 'publicURL'
V1_SHELL = 'cinderclient.v1.shell'
@@ -879,7 +874,7 @@ class OpenStackCinderShell(object):
ks_discover = discover.Discover(session=session, url=auth_url)
v2_auth_url = ks_discover.url_for('2.0')
v3_auth_url = ks_discover.url_for('3.0')
- except DiscoveryFailure:
+ except exceptions.DiscoveryFailure:
# Discovery response mismatch. Raise the error
raise
except Exception: