From dc6ec67c5c06d411e06e03d393bac863399a67b6 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Wed, 2 May 2012 09:41:10 -0400 Subject: Remove common.exception from common.importutils. This patch removes the usage of common.exception from common.importutils. Instead of raising exception.NotFound() from importutils.import_class(), just use the built-in ImportError. Change-Id: I95e84908d1f80c5ca3bbac049eda8faa64212ae0 --- openstack/common/importutils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'openstack') diff --git a/openstack/common/importutils.py b/openstack/common/importutils.py index 48b7af1..7654af5 100644 --- a/openstack/common/importutils.py +++ b/openstack/common/importutils.py @@ -21,8 +21,6 @@ Import related utilities and helper functions. import sys -from openstack.common import exception - def import_class(import_str): """Returns a class from a string including module and class""" @@ -31,7 +29,7 @@ def import_class(import_str): __import__(mod_str) return getattr(sys.modules[mod_str], class_str) except (ImportError, ValueError, AttributeError), exc: - raise exception.NotFound('Class %s cannot be found (%s)' % + raise ImportError('Class %s cannot be found (%s)' % (class_str, str(exc))) -- cgit