summaryrefslogtreecommitdiff
path: root/keystoneclient/base.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-10-14 14:10:27 +0000
committerGerrit Code Review <review@openstack.org>2016-10-14 14:10:27 +0000
commit3c8f1276a2f874f3fcaf7db08761d79bd013cf28 (patch)
tree2f62081bef16cf57fa965434725198e703670b62 /keystoneclient/base.py
parent090e2c8e2839cea0528a494d0017643c64d53f03 (diff)
parent5b91fedd650613f7ba480039fca7df83c1ff6bed (diff)
downloadpython-keystoneclient-3c8f1276a2f874f3fcaf7db08761d79bd013cf28.tar.gz
Merge "Use exceptions from Keystoneauth"
Diffstat (limited to 'keystoneclient/base.py')
-rw-r--r--keystoneclient/base.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/keystoneclient/base.py b/keystoneclient/base.py
index af07db2..8bc4c82 100644
--- a/keystoneclient/base.py
+++ b/keystoneclient/base.py
@@ -22,12 +22,13 @@ import copy
import functools
import warnings
+from keystoneauth1 import exceptions as ksa_exceptions
from keystoneauth1 import plugin
from oslo_utils import strutils
import six
from six.moves import urllib
-from keystoneclient import exceptions
+from keystoneclient import exceptions as ksc_exceptions
from keystoneclient.i18n import _
@@ -226,8 +227,8 @@ class Manager(object):
resp, body = methods[method](url, body=body,
**kwargs)
except KeyError:
- raise exceptions.ClientException(_("Invalid update method: %s")
- % method)
+ raise ksc_exceptions.ClientException(_("Invalid update method: %s")
+ % method)
# PUT requests may not return a body
if body:
return self.resource_class(self, body[response_key])
@@ -253,9 +254,9 @@ class ManagerWithFind(Manager):
if num == 0:
msg = _("No %(name)s matching %(kwargs)s.") % {
'name': self.resource_class.__name__, 'kwargs': kwargs}
- raise exceptions.NotFound(404, msg)
+ raise ksa_exceptions.NotFound(404, msg)
elif num > 1:
- raise exceptions.NoUniqueMatch
+ raise ksc_exceptions.NoUniqueMatch
else:
return rl[0]
@@ -384,7 +385,7 @@ class CrudManager(Manager):
return self._list(
url_query,
self.collection_key)
- except exceptions.EmptyCatalog:
+ except ksa_exceptions.EmptyCatalog:
if fallback_to_auth:
return self._list(
url_query,
@@ -431,9 +432,9 @@ class CrudManager(Manager):
if num == 0:
msg = _("No %(name)s matching %(kwargs)s.") % {
'name': self.resource_class.__name__, 'kwargs': kwargs}
- raise exceptions.NotFound(404, msg)
+ raise ksa_exceptions.NotFound(404, msg)
elif num > 1:
- raise exceptions.NoUniqueMatch
+ raise ksc_exceptions.NoUniqueMatch
else:
return rl[0]