Skip to content
Snippets Groups Projects
Unverified Commit fe7929cd authored by Rafael Guterres Jeffman's avatar Rafael Guterres Jeffman Committed by GitHub
Browse files

Merge pull request #544 from t-woerner/ansible_doc_test__fix_ansible_library

ansible-doc-test: ANSIBLE_LIBRARY needs to be set internally
parents f83457f4 a0700577
Branches
Tags
No related merge requests found
...@@ -15,7 +15,7 @@ jobs: ...@@ -15,7 +15,7 @@ jobs:
- name: Run ansible-doc-test - name: Run ansible-doc-test
run: | run: |
python -m pip install "ansible < 2.10" python -m pip install "ansible < 2.10"
ANSIBLE_LIBRARY="." python utils/ansible-doc-test roles plugins ANSIBLE_LIBRARY="." python utils/ansible-doc-test -v roles plugins
check_docs_latest: check_docs_latest:
name: Check Ansible Documentation with latest Ansible. name: Check Ansible Documentation with latest Ansible.
...@@ -28,5 +28,5 @@ jobs: ...@@ -28,5 +28,5 @@ jobs:
- name: Run ansible-doc-test - name: Run ansible-doc-test
run: | run: |
python -m pip install ansible python -m pip install ansible
ANSIBLE_LIBRARY="." python utils/ansible-doc-test roles plugins ANSIBLE_LIBRARY="." python utils/ansible-doc-test -v roles plugins
...@@ -26,6 +26,6 @@ repos: ...@@ -26,6 +26,6 @@ repos:
- id: ansible-doc-test - id: ansible-doc-test
name: Verify Ansible roles and module documentation. name: Verify Ansible roles and module documentation.
language: python language: python
entry: env ANSIBLE_LIBRARY=./plugins/modules utils/ansible-doc-test entry: utils/ansible-doc-test
# args: ['-v', 'roles', 'plugins'] # args: ['-v', 'roles', 'plugins']
files: ^.*.py$ files: ^.*.py$
...@@ -29,12 +29,16 @@ import subprocess ...@@ -29,12 +29,16 @@ import subprocess
def run_ansible_doc(role, module, verbose=False): def run_ansible_doc(role, module, verbose=False):
playbook_dir, module_path = get_playbook_dir(role, module) playbook_dir, module_path = get_playbook_dir(role, module)
module_dir = os.path.dirname(module_path)
command = ["ansible-doc", command = ["env",
"ANSIBLE_LIBRARY=%s" % module_dir,
"ansible-doc",
"--playbook-dir=%s" % playbook_dir, "--playbook-dir=%s" % playbook_dir,
"--type=module", "--type=module",
"-vvv", "-vvv",
module] module]
process = subprocess.run(command, process = subprocess.run(command,
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE) stderr=subprocess.PIPE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment