mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-06 13:23:14 +00:00
ansible-doc-test: Set ANSIBLE_LIBRARY using module_dir internally
ANSIBLE_LIBRARY needs to be set properly for new Ansible version 4.0.0 to make sure that it is able to find the module that is checked. For every file that needs to be checked, there is a separate ansible-doc call. ANSIBLE_LIBRARY is set using os.path.dirname on the module_path.
This commit is contained in:
@@ -29,12 +29,16 @@ import subprocess
|
||||
|
||||
def run_ansible_doc(role, module, verbose=False):
|
||||
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,
|
||||
"--type=module",
|
||||
"-vvv",
|
||||
module]
|
||||
|
||||
process = subprocess.run(command,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
|
||||
Reference in New Issue
Block a user