Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 8, 2024
1 parent eb18cc9 commit 8bbae02
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
3 changes: 0 additions & 3 deletions covalent_ssh_plugin/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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(
Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tests/ssh_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 8bbae02

Please sign in to comment.