From 5a54e25f0f85007c526431818deb2b736daaef1e Mon Sep 17 00:00:00 2001 From: Carsten Grohmann Date: Wed, 23 Aug 2023 15:27:07 +0200 Subject: [PATCH] Fix output of error message cmp is a string already. Therefore, the join() statement is not necessary and only introduces additional spaces. --- testinfra/utils/ansible_runner.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/testinfra/utils/ansible_runner.py b/testinfra/utils/ansible_runner.py index 8bd46a31..b9eb2f12 100644 --- a/testinfra/utils/ansible_runner.py +++ b/testinfra/utils/ansible_runner.py @@ -383,9 +383,7 @@ def run_module( "msg": "Skipped. You might want to try check=False", } if not files: - raise RuntimeError( - "Error while running {}: {}".format(" ".join(cmd), out) - ) + raise RuntimeError(f"{out}") fpath = os.path.join(d, files[0]) try: with open(fpath, "r", encoding="ascii") as f: