diff options
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/importer.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cloudinit/importer.py b/cloudinit/importer.py index 0344d0de..a36b87bc 100644 --- a/cloudinit/importer.py +++ b/cloudinit/importer.py @@ -22,10 +22,18 @@ import sys +from cloudinit import log as logging +from cloudinit import util +LOG = logging.getLogger(__name__) + + +# Simple wrapper that allows us to add more logging in... def import_module(module_name): try: + LOG.debug("Attempting to import module %s", module_name) __import__(module_name) return sys.modules[module_name] - except ImportError as err: - raise RuntimeError('Could not load module %s: %s' % (module_name, err)) + except: + util.logexc(LOG, 'Failed at importing %s', module_name) + raise |