summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@gmail.com>2013-07-21 11:04:55 -0700
committerJoshua Harlow <harlowja@gmail.com>2013-07-21 11:04:55 -0700
commitd655d019fb0a45389d87db39b0ef5001e27e2616 (patch)
treef40e5127bbff68e0efcc23810365f2fe9abe7741
parenta5dd2146bb98874219eb449ae06f57203099d4d4 (diff)
downloadvyos-cloud-init-d655d019fb0a45389d87db39b0ef5001e27e2616.tar.gz
vyos-cloud-init-d655d019fb0a45389d87db39b0ef5001e27e2616.zip
Ensure what we are searching over is a directory.
-rw-r--r--cloudinit/stages.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/cloudinit/stages.py b/cloudinit/stages.py
index f08589a7..3e49e8c5 100644
--- a/cloudinit/stages.py
+++ b/cloudinit/stages.py
@@ -360,6 +360,8 @@ class Init(object):
def register_handlers_in_dir(path):
# Attempts to register any handler modules under the given path.
+ if not path or not os.path.isdir(path):
+ return
potential_handlers = util.find_modules(path)
for (fname, mod_name) in potential_handlers.iteritems():
try: