def list_ansible_modules(): # inspired by # https://github.com/ansible/ansible/blob/devel/bin/ansible-doc paths = (p for p in module_finder._get_paths() if os.path.isdir(p)) modules = set() for path in paths: modules.update(m for m in get_modules_from_path(path)) return modules
def list_ansible_modules(): # constant and code copied from ansible # https://github.com/ansible/ansible/blob/devel/bin/ansible-doc BLACKLIST_EXTS = ('.swp', '.bak', '~', '.rpm') paths = (p for p in module_finder._get_paths() if os.path.isdir(p)) modules = [] for path in paths: modules.extend(m for m in os.listdir(path) if m not in BLACKLIST_EXTS) return modules