ansible-doc-test: Ignore role if library directory does not exist.

This change make ansible-doc-test skip processing a role if it does
not contain a `library` directory.
This commit is contained in:
Rafael Guterres Jeffman
2020-11-17 13:53:10 -03:00
parent b32b1b02cc
commit 18d90c70b3

View File

@@ -124,7 +124,10 @@ def ansible_doc_test(path, verbose):
# All roles and plugins
roles = os.listdir("roles/")
for _role in roles:
if not os.path.isdir("roles/%s" % _role):
if (
not os.path.isdir("roles/%s" % _role)
or not os.path.isdir("roles/%s/library" % _role)
):
continue
modules = os.listdir("roles/%s/library" % _role)
for _module in modules: