diff --git a/src/ansible_compat/runtime.py b/src/ansible_compat/runtime.py index 1ffe3e01..c5c798b2 100644 --- a/src/ansible_compat/runtime.py +++ b/src/ansible_compat/runtime.py @@ -341,11 +341,12 @@ def run( # ruff: disable=PLR0913 if result.returncode == 0: break _logger.debug("Environment: %s", env or self.environ) - _logger.warning( - "Retrying execution failure %s of: %s", - result.returncode, - " ".join(args), - ) + if retry: + _logger.warning( + "Retrying execution failure %s of: %s", + result.returncode, + " ".join(args), + ) return result @property