From 399cbb6436fabc3cf9824df0176e2115ab9788a5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Dec 2023 17:02:31 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- covalent_ssh_plugin/ssh.py | 3 --- tests/ssh_test.py | 2 -- 2 files changed, 5 deletions(-) diff --git a/covalent_ssh_plugin/ssh.py b/covalent_ssh_plugin/ssh.py index c1444ed..a736277 100644 --- a/covalent_ssh_plugin/ssh.py +++ b/covalent_ssh_plugin/ssh.py @@ -90,7 +90,6 @@ def __init__( max_connection_attempts: int = 5, retry_wait_time: int = 5, ) -> None: - remote_cache = ( remote_cache or get_config("executors.ssh.remote_cache") or ".cache/covalent" ) @@ -256,7 +255,6 @@ async def _attempt_client_connect(self) -> Optional[asyncssh.SSHClientConnection attempt = 0 while attempt < attempt_max: - try: # Exit here if the connection is successful. return await asyncssh.connect( @@ -266,7 +264,6 @@ async def _attempt_client_connect(self) -> Optional[asyncssh.SSHClientConnection known_hosts=None, ) except _retry_errs as err: - if not self.retry_connect: app_log.error(f"{err} ({address} | retry disabled).") raise err diff --git a/tests/ssh_test.py b/tests/ssh_test.py index acedaf3..8966d3c 100644 --- a/tests/ssh_test.py +++ b/tests/ssh_test.py @@ -146,7 +146,6 @@ class _FakeResultFailed: mocker.patch("covalent_ssh_plugin.ssh.SSHExecutor.submit_task", return_value=_result) async with aiofiles.tempfile.NamedTemporaryFile("w") as f: - executor = SSHExecutor( username="user", hostname="host", @@ -198,7 +197,6 @@ async def test_client_connect_retry_attempts(mocker): # Dummy used to patch `asyncssh.connect` calls. async def _mock_asyncssh_connect(*args, **kwargs): - # Set `counter = -1` to test immediate success. if _mock_asyncssh_connect.err_counter < 0: return "immediate_connection_object" # Success.