1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02: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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- terraform module - disable ANSI escape sequences during validation phase (https://github.com/ansible-collections/community.general/pull/5843).

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):