diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-07-11 22:38:10 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-07-11 22:38:10 +0000 |
| commit | 46405973410b5e64baec09f293d4752b4f94dd0e (patch) | |
| tree | 9c4d505171a271dbfe6a0a19a1847a493a80cf95 /openstack/common | |
| parent | 289a0b328b96693944faf69b43124d4449cdbded (diff) | |
| parent | 8c74b37f5bdf1141b8c3724c8df460e6562d1985 (diff) | |
| download | oslo-46405973410b5e64baec09f293d4752b4f94dd0e.tar.gz oslo-46405973410b5e64baec09f293d4752b4f94dd0e.tar.xz oslo-46405973410b5e64baec09f293d4752b4f94dd0e.zip | |
Merge "Improve exception from importutils.import_class()."
Diffstat (limited to 'openstack/common')
| -rw-r--r-- | openstack/common/importutils.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/openstack/common/importutils.py b/openstack/common/importutils.py index 67d94ad..2fbb029 100644 --- a/openstack/common/importutils.py +++ b/openstack/common/importutils.py @@ -20,6 +20,7 @@ Import related utilities and helper functions. """ import sys +import traceback def import_class(import_str): @@ -30,7 +31,8 @@ def import_class(import_str): return getattr(sys.modules[mod_str], class_str) except (ImportError, ValueError, AttributeError), exc: raise ImportError('Class %s cannot be found (%s)' % - (class_str, str(exc))) + (class_str, + traceback.format_exception(*sys.exc_info()))) def import_object(import_str, *args, **kwargs): |
