From 392a3e31ec82a9ffb73944139f77702b4e862aa3 Mon Sep 17 00:00:00 2001 From: Manuel Giffels Date: Thu, 9 Nov 2023 19:27:28 +0100 Subject: [PATCH] Apply change from review --- docs/source/changelog.rst | 4 ++-- tardis/utilities/executors/sshexecutor.py | 2 +- tests/utilities_t/executors_t/test_sshexecutor.py | 4 +--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index 82d10bc2..f9e7ec60 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -1,4 +1,4 @@ -.. Created by changelog.py at 2023-11-09, command +.. Created by changelog.py at 2023-11-10, command '/Users/giffler/.cache/pre-commit/repor6pnmwlm/py_env-python3.10/bin/changelog docs/source/changes compile --categories Added Changed Fixed Security Deprecated --output=docs/source/changelog.rst' based on the format of 'https://keepachangelog.com/' @@ -6,7 +6,7 @@ CHANGELOG ######### -[Unreleased] - 2023-11-09 +[Unreleased] - 2023-11-10 ========================= Fixed diff --git a/tardis/utilities/executors/sshexecutor.py b/tardis/utilities/executors/sshexecutor.py index 4331e549..d0d4e2a1 100644 --- a/tardis/utilities/executors/sshexecutor.py +++ b/tardis/utilities/executors/sshexecutor.py @@ -90,7 +90,7 @@ async def run_command(self, command, stdin_input=None): async with self.bounded_connection as ssh_connection: try: response = await ssh_connection.run( - command, check=True, input=stdin_input and stdin_input + command, check=True, input=stdin_input ) except asyncssh.ProcessError as pe: raise CommandExecutionFailure( diff --git a/tests/utilities_t/executors_t/test_sshexecutor.py b/tests/utilities_t/executors_t/test_sshexecutor.py index c0c48674..c789ece6 100644 --- a/tests/utilities_t/executors_t/test_sshexecutor.py +++ b/tests/utilities_t/executors_t/test_sshexecutor.py @@ -42,9 +42,7 @@ async def run(self, command, input=None, **kwargs): await asyncio.sleep(float(duration)) elif command != "Test": raise ValueError(f"Unsupported mock command: {command}") - return AttributeDict( - stdout=input and input, stderr="TestError", exit_status=0 - ) + return AttributeDict(stdout=input, stderr="TestError", exit_status=0) async def create_process(self): @asynccontextmanager