summaryrefslogtreecommitdiff
path: root/cloudinit/importer.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2013-10-09 12:22:06 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2013-10-09 12:22:06 -0700
commit47d15924ea38f249a2c54d33dd24c3c284c4eb72 (patch)
treef9ca392fa407f6d3fde541e9cf9868b1537c65a6 /cloudinit/importer.py
parent7af11ba50c8311ceb545b830716c78929079a0cd (diff)
downloadvyos-cloud-init-47d15924ea38f249a2c54d33dd24c3c284c4eb72.tar.gz
vyos-cloud-init-47d15924ea38f249a2c54d33dd24c3c284c4eb72.zip
Log message around import failure
In certain cases import failure is expected and in certain cases it is not expected, in either case it is useful to at least log the failure.
Diffstat (limited to 'cloudinit/importer.py')
-rw-r--r--cloudinit/importer.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/cloudinit/importer.py b/cloudinit/importer.py
index 71cf2726..a094141a 100644
--- a/cloudinit/importer.py
+++ b/cloudinit/importer.py
@@ -36,6 +36,7 @@ def find_module(base_name, search_paths, required_attrs=None):
found_places = []
if not required_attrs:
required_attrs = []
+ # NOTE(harlowja): translate the search paths to include the base name.
real_paths = []
for path in search_paths:
real_path = []
@@ -50,8 +51,9 @@ def find_module(base_name, search_paths, required_attrs=None):
mod = None
try:
mod = import_module(full_path)
- except ImportError:
- pass
+ except ImportError as e:
+ LOG.debug("Failed at attempted import of '%s' due to: %s",
+ full_path, e)
if not mod:
continue
found_attrs = 0