Skip to content

Commit

Permalink
invoke ansible-galaxy with increased verbosity and always log stdout …
Browse files Browse the repository at this point in the history
…at INFO level

This makes ansible-galaxy display important info, when logging level is increased. This helps debugging ansible-lint.

Signed-off-by: Daniel Ziegenberg <[email protected]>
  • Loading branch information
ziegenberg committed May 23, 2023
1 parent 34c1459 commit bde85a2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ansible_compat/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def install_requirements( # noqa: C901
"ansible-galaxy",
"role",
"install",
"-vr",
"-vvvr",
f"{requirement}",
]
if self.cache_dir:
Expand All @@ -440,6 +440,7 @@ def install_requirements( # noqa: C901
_logger.info("Running %s", " ".join(cmd))

result = self.run(cmd, retry=retry)
_logger.info(result.stdout)
if result.returncode != 0:
_logger.error(result.stdout)
raise AnsibleCommandError(result)
Expand All @@ -450,7 +451,7 @@ def install_requirements( # noqa: C901
"ansible-galaxy",
"collection",
"install",
"-v",
"-vvv",
]
if offline:
_logger.warning(
Expand All @@ -472,8 +473,8 @@ def install_requirements( # noqa: C901
retry=retry,
env={**os.environ, "ANSIBLE_COLLECTIONS_PATH": ":".join(cpaths)},
)
_logger.info(result.stdout)
if result.returncode != 0:
_logger.error(result.stdout)
_logger.error(result.stderr)
raise AnsibleCommandError(result)

Expand Down

0 comments on commit bde85a2

Please sign in to comment.