diff options
author | Michael DeHaan <michael@ansibleworks.com> | 2013-04-20 12:31:14 -0400 |
---|---|---|
committer | Michael DeHaan <michael@ansibleworks.com> | 2013-04-20 12:31:14 -0400 |
commit | e6bf01a6b0baf438cdb30129433fda1763bb8909 (patch) | |
tree | 710ec8d289eb330ed6b8923c9cf2a2f652044ffd /bin/ansible-doc | |
parent | 5a8dff5bce7287c37386ac256ef6d12a287007c9 (diff) | |
download | ansible-e6bf01a6b0baf438cdb30129433fda1763bb8909.tar.gz |
Make plugin loader path operations more efficient.
Diffstat (limited to 'bin/ansible-doc')
-rwxr-xr-x | bin/ansible-doc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/bin/ansible-doc b/bin/ansible-doc index c1d3243de0..d3cd614d10 100755 --- a/bin/ansible-doc +++ b/bin/ansible-doc @@ -170,13 +170,23 @@ def main(): if len(args) == 0: p.print_help() - + + def print_paths(finder): + ''' Returns a string suitable for printing of the search path ''' + + # Uses a list to get the order right + ret = [] + for i in finder._get_paths(): + if i not in ret: + ret.append(i) + return os.pathsep.join(ret) + for module in args: filename = utils.plugins.module_finder.find_plugin(module) if filename is None: sys.stderr.write("module %s not found in %s\n" % (module, - utils.plugins.module_finder.print_paths())) + print_paths(utils.plugins.module_finder))) continue if any(filename.endswith(x) for x in BLACKLIST_EXTS): |