From 25cc79e2db5a79fd6d8022d916d20f821fab87ba Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Fri, 26 Sep 2014 10:55:00 -0400 Subject: [PATCH] Modules is a package. --- lib/ansible/modules/__init__.py | 0 lib/ansible/utils/plugins.py | 9 ++++++++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 lib/ansible/modules/__init__.py diff --git a/lib/ansible/modules/__init__.py b/lib/ansible/modules/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/lib/ansible/utils/plugins.py b/lib/ansible/utils/plugins.py index 327bc99cec..f83155412f 100644 --- a/lib/ansible/utils/plugins.py +++ b/lib/ansible/utils/plugins.py @@ -101,7 +101,14 @@ class PluginLoader(object): for basedir in _basedirs: fullpath = os.path.realpath(os.path.join(basedir, self.subdir)) if os.path.isdir(fullpath): + files = glob.glob("%s/*" % fullpath) + + # allow directories to be two levels deep + files2 = glob.glob("%s/*/*" % fullpath) + + files = files.extend(files2) + for file in files: if os.path.isdir(file) and file not in ret: ret.append(file) @@ -232,7 +239,7 @@ shell_loader = PluginLoader( module_finder = PluginLoader( '', - '', + 'ansible.modules', C.DEFAULT_MODULE_PATH, 'library' )