summaryrefslogtreecommitdiff
path: root/glanceclient/common/utils.py
diff options
context:
space:
mode:
authorBrian Waldon <bcwaldon@gmail.com>2012-07-12 18:30:54 -0700
committerBrian Waldon <bcwaldon@gmail.com>2012-07-13 18:38:15 -0700
commit53acf1a0ca70c900267286a249e476fffe078a9f (patch)
treefe9d1c8db6b2767e2a0479abc154e42003ca326d /glanceclient/common/utils.py
parent49bc6f94f29ee7286601be0451ab3dafc82a0750 (diff)
downloadpython-glanceclient-53acf1a0ca70c900267286a249e476fffe078a9f.tar.gz
Establish the supported importable interface
* Consumers of this client should not depend on being able to import any module other than glanceclient and glanceclient * The only attributs of the glanceclient module are Client and __version__ * The attributes of the glanceclient.exc modules have yet to be locked down * glanceclient.common.exceptions was replaced with a placeholder module until consumers of it are updated Change-Id: Iea9648cd06906d65764987c1f2ee5a88ebeee748
Diffstat (limited to 'glanceclient/common/utils.py')
-rw-r--r--glanceclient/common/utils.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/glanceclient/common/utils.py b/glanceclient/common/utils.py
index 1b79231..8bbb7ac 100644
--- a/glanceclient/common/utils.py
+++ b/glanceclient/common/utils.py
@@ -18,7 +18,7 @@ import uuid
import prettytable
-from glanceclient.common import exceptions
+from glanceclient import exc
from glanceclient.openstack.common import importutils
@@ -67,23 +67,23 @@ def find_resource(manager, name_or_id):
try:
if isinstance(name_or_id, int) or name_or_id.isdigit():
return manager.get(int(name_or_id))
- except exceptions.NotFound:
+ except exc.NotFound:
pass
# now try to get entity as uuid
try:
uuid.UUID(str(name_or_id))
return manager.get(name_or_id)
- except (ValueError, exceptions.NotFound):
+ except (ValueError, exc.NotFound):
pass
# finally try to find entity by name
try:
return manager.find(name=name_or_id)
- except exceptions.NotFound:
+ except exc.NotFound:
msg = "No %s with a name or ID of '%s' exists." % \
(manager.resource_class.__name__.lower(), name_or_id)
- raise exceptions.CommandError(msg)
+ raise exc.CommandError(msg)
def skip_authentication(f):