From 53acf1a0ca70c900267286a249e476fffe078a9f Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Thu, 12 Jul 2012 18:30:54 -0700 Subject: 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 --- glanceclient/common/utils.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'glanceclient/common/utils.py') 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): -- cgit v1.2.1