Skip to content

Commit

Permalink
pleased linter
Browse files Browse the repository at this point in the history
  • Loading branch information
XaverStiensmeier committed Dec 2, 2024
1 parent 496f78f commit c3b6ea9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,8 @@ min-public-methods=2
[EXCEPTIONS]

# Exceptions that will emit a warning when caught.
overgeneral-exceptions=BaseException,
Exception
overgeneral-exceptions=builtins.BaseException,
builtins.Exception


[STRING]
Expand Down
24 changes: 12 additions & 12 deletions bibigrid/core/utility/handler/ssh_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def is_active(client, paramiko_key, ssh_data, log):
log.info(f"Successfully connected to {ssh_data['floating_ip']}.")
except paramiko.ssh_exception.NoValidConnectionsError as exc:
if attempts < ssh_data['timeout']:
sleep_time = 2 ** (attempts+2)
sleep_time = 2 ** (attempts + 2)
time.sleep(sleep_time)
log.info(f"Waiting {sleep_time} before attempting to reconnect.")
attempts += 1
Expand Down Expand Up @@ -209,14 +209,14 @@ def execute_ssh(ssh_data, log):
log.error(f"Couldn't connect to ip {ssh_data['gateway'] or ssh_data['floating_ip']} using private key "
f"{ssh_data['private_key']}.")
raise exc
else:
log.debug(f"Setting up {ssh_data['floating_ip']}")
if ssh_data['filepaths']:
log.debug(f"Setting up filepaths for {ssh_data['floating_ip']}")
sftp = client.open_sftp()
for local_path, remote_path in ssh_data['filepaths']:
copy_to_server(sftp=sftp, local_path=local_path, remote_path=remote_path, log=log)
log.debug("SFTP: Files %s copied.", ssh_data['filepaths'])
if ssh_data["floating_ip"]:
log.debug(f"Setting up commands for {ssh_data['floating_ip']}")
execute_ssh_cml_commands(client=client, commands=ssh_data["commands"], log=log)

log.debug(f"Setting up {ssh_data['floating_ip']}")
if ssh_data['filepaths']:
log.debug(f"Setting up filepaths for {ssh_data['floating_ip']}")
sftp = client.open_sftp()
for local_path, remote_path in ssh_data['filepaths']:
copy_to_server(sftp=sftp, local_path=local_path, remote_path=remote_path, log=log)
log.debug("SFTP: Files %s copied.", ssh_data['filepaths'])
if ssh_data["floating_ip"]:
log.debug(f"Setting up commands for {ssh_data['floating_ip']}")
execute_ssh_cml_commands(client=client, commands=ssh_data["commands"], log=log)
2 changes: 1 addition & 1 deletion bibigrid/models/return_threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ReturnThread(threading.Thread):
"""

# pylint: disable=dangerous-default-value
def __init__(self, group=None, target=None, name=None, args=(),
def __init__(self, *, group=None, target=None, name=None, args=(),
kwargs={}):
threading.Thread.__init__(self, group, target, name, args, kwargs)
self._return = None
Expand Down

0 comments on commit c3b6ea9

Please sign in to comment.