diff --git a/CHANGELOG.md b/CHANGELOG.md index 55a24cb..4ed1dc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [UNRELEASED] +### Changed + +- Check `result.returncode != 0` inside `run` method before deferring to `_on_ssh_fail`. + ## [0.20.0] - 2022-12-15 ### Changed diff --git a/covalent_ssh_plugin/ssh.py b/covalent_ssh_plugin/ssh.py index 505ae19..ebf7b15 100644 --- a/covalent_ssh_plugin/ssh.py +++ b/covalent_ssh_plugin/ssh.py @@ -500,7 +500,8 @@ async def run( if result_err := result.stderr.strip(): app_log.warning(result_err) - return self._on_ssh_fail(function, args, kwargs, result_err) + if result.returncode != 0: + return self._on_ssh_fail(function, args, kwargs, result_err) if not await self._poll_task(conn, remote_result_file): message = (