Skip to content

Commit

Permalink
Avoid stdout pollution cause by ansible logging (#287)
Browse files Browse the repository at this point in the history
* Remove debug information prior to json string

* Update runtime.py

---------

Co-authored-by: Sorin Sbarnea <ssbarnea@redhat.com>
  • Loading branch information
audgirka and ssbarnea committed Jun 1, 2023
1 parent c6aa776 commit 8ef850d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ansible_compat/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,9 @@ def run( # ruff: disable=PLR0913
# from parsing its JSON output due to extra debug messages on stdout.
env["ANSIBLE_DEBUG"] = "0"

# https://github.com/ansible/ansible-lint/issues/3522
env["ANSIBLE_VERBOSE_TO_STDERR"] = "True"

for _ in range(self.max_retries + 1 if retry else 1):
result = run_func(
args,
Expand Down

0 comments on commit 8ef850d

Please sign in to comment.