1
0
mirror of https://github.com/ansible-collections/community.general.git synced 2025-07-29 07:41:16 +03:00

Add -no-color argument to terraform validation (#5843)

This commit is contained in:
Kristian Heljas
2023-01-16 23:54:07 +02:00
committed by GitHub
parent 937dea6af3
commit 44172ddaa6
2 changed files with 4 additions and 2 deletions

View File

@ -299,9 +299,9 @@ def preflight_validation(bin_path, project_path, version, variables_args=None, p
if not os.path.isdir(project_path):
module.fail_json(msg="Path for Terraform project '{0}' doesn't exist on this host - check the path and try again please.".format(project_path))
if LooseVersion(version) < LooseVersion('0.15.0'):
rc, out, err = module.run_command([bin_path, 'validate'] + variables_args, check_rc=True, cwd=project_path)
module.run_command([bin_path, 'validate', '-no-color'] + variables_args, check_rc=True, cwd=project_path)
else:
rc, out, err = module.run_command([bin_path, 'validate'], check_rc=True, cwd=project_path)
module.run_command([bin_path, 'validate', '-no-color'], check_rc=True, cwd=project_path)
def _state_args(state_file):