From b3b356480da93d9266a9a846c364b2a74f4d0085 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Mon, 27 Oct 2014 15:52:56 -0700 Subject: [PATCH] added the ability to keep aliased and deprecated modules prefixed with '_', they will be loaded after non prefixed modules are checked they can be full modules or symlinks to existing ones (alias) also updated ansible doc to ignore these, will eventually add selective display --- bin/ansible-doc | 4 +++- lib/ansible/utils/plugins.py | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/ansible-doc b/bin/ansible-doc index d5143f33a15..8a7faadb244 100755 --- a/bin/ansible-doc +++ b/bin/ansible-doc @@ -225,11 +225,13 @@ def main(): # list all modules paths = utils.plugins.module_finder._get_paths() module_list = [] + deprecated_list = [] + module_aliases = {} for path in paths: # os.system("ls -C %s" % (path)) if os.path.isdir(path): for module in os.listdir(path): - if any(module.endswith(x) for x in BLACKLIST_EXTS): + if module.startswith('_') or any(module.endswith(x) for x in BLACKLIST_EXTS): continue module_list.append(module) diff --git a/lib/ansible/utils/plugins.py b/lib/ansible/utils/plugins.py index faf5b5f26fe..0d050fd13d7 100644 --- a/lib/ansible/utils/plugins.py +++ b/lib/ansible/utils/plugins.py @@ -178,6 +178,9 @@ class PluginLoader(object): self._plugin_path_cache[full_name] = path return path + if not name.startswith('_'): + return self.find_plugin('_' + name, suffixes, transport) + return None def has_plugin(self, name):