mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[PR #5843/44172dda backport][stable-6] Add -no-color argument to terraform validation (#5847)
Add -no-color argument to terraform validation (#5843)
(cherry picked from commit 44172ddaa6
)
Co-authored-by: Kristian Heljas <11139388+kristianheljas@users.noreply.github.com>
This commit is contained in:
parent
490baed566
commit
b400491ef3
2 changed files with 4 additions and 2 deletions
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- terraform module - disable ANSI escape sequences during validation phase (https://github.com/ansible-collections/community.general/pull/5843).
|
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue