summaryrefslogtreecommitdiff
path: root/cloudinit/stages.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2014-09-03 14:46:20 -0400
committerScott Moser <smoser@ubuntu.com>2014-09-03 14:46:20 -0400
commit9eddc072644bf212d93b2247e1d121e3208546db (patch)
tree33434690ef0f6f85227ad8b1107d0059a74da198 /cloudinit/stages.py
parent141a8329d7650b1e9c80364f289b7f399477e5fc (diff)
parent141caf7f3b224c0265c7bb0014b96ca08aa67193 (diff)
downloadvyos-cloud-init-9eddc072644bf212d93b2247e1d121e3208546db.tar.gz
vyos-cloud-init-9eddc072644bf212d93b2247e1d121e3208546db.zip
improved logging of errors around module loading/searching
Diffstat (limited to 'cloudinit/stages.py')
-rw-r--r--cloudinit/stages.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/cloudinit/stages.py b/cloudinit/stages.py
index d29d480a..67f467f7 100644
--- a/cloudinit/stages.py
+++ b/cloudinit/stages.py
@@ -386,12 +386,12 @@ class Init(object):
potential_handlers = util.find_modules(path)
for (fname, mod_name) in potential_handlers.iteritems():
try:
- mod_locs = importer.find_module(mod_name, [''],
- ['list_types',
- 'handle_part'])
+ mod_locs, looked_locs = importer.find_module(
+ mod_name, [''], ['list_types', 'handle_part'])
if not mod_locs:
- LOG.warn(("Could not find a valid user-data handler"
- " named %s in file %s"), mod_name, fname)
+ LOG.warn("Could not find a valid user-data handler"
+ " named %s in file %s (searched %s)",
+ mod_name, fname, looked_locs)
continue
mod = importer.import_module(mod_locs[0])
mod = handlers.fixup_handler(mod)
@@ -621,11 +621,11 @@ class Modules(object):
" has an unknown frequency %s"), raw_name, freq)
# Reset it so when ran it will get set to a known value
freq = None
- mod_locs = importer.find_module(mod_name,
- ['', type_utils.obj_name(config)],
- ['handle'])
+ mod_locs, looked_locs = importer.find_module(
+ mod_name, ['', type_utils.obj_name(config)], ['handle'])
if not mod_locs:
- LOG.warn("Could not find module named %s", mod_name)
+ LOG.warn("Could not find module named %s (searched %s)",
+ mod_name, looked_locs)
continue
mod = config.fixup_module(importer.import_module(mod_locs[0]))
mostly_mods.append([mod, raw_name, freq, run_args])