1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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
This commit is contained in:
Brian Coca 2014-10-27 15:52:56 -07:00
parent 7ea84d7499
commit b3b356480d
2 changed files with 6 additions and 1 deletions

View file

@ -225,11 +225,13 @@ def main():
# list all modules # list all modules
paths = utils.plugins.module_finder._get_paths() paths = utils.plugins.module_finder._get_paths()
module_list = [] module_list = []
deprecated_list = []
module_aliases = {}
for path in paths: for path in paths:
# os.system("ls -C %s" % (path)) # os.system("ls -C %s" % (path))
if os.path.isdir(path): if os.path.isdir(path):
for module in os.listdir(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 continue
module_list.append(module) module_list.append(module)

View file

@ -178,6 +178,9 @@ class PluginLoader(object):
self._plugin_path_cache[full_name] = path self._plugin_path_cache[full_name] = path
return path return path
if not name.startswith('_'):
return self.find_plugin('_' + name, suffixes, transport)
return None return None
def has_plugin(self, name): def has_plugin(self, name):