From afd22be9fd77b98bf3adea424b54c487dbdd5f9c Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Thu, 25 May 2023 17:37:04 +0100 Subject: [PATCH] Log retry attempt entryu only when doing retries (#283) --- src/ansible_compat/runtime.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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