Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit fc36226

Browse files
committed
Do not fail on SSH private key filemode check
- Always failing prevents execution on WSL - Log warning instead
1 parent f48c0ea commit fc36226

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

convoy/batch.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -726,9 +726,8 @@ def generate_ssh_tunnel_script(batch_client, pool, ssh_priv_key, nodes):
726726
return
727727
if not crypto.check_ssh_private_key_filemode(ssh_priv_key):
728728
logger.warning(
729-
('cannot generate tunnel script with private SSH key that '
730-
'is too permissive: {}').format(ssh_priv_key))
731-
return
729+
'SSH private key filemode is too permissive: {}'.format(
730+
ssh_priv_key))
732731
ssh_args = [
733732
'ssh', '-o', 'StrictHostKeyChecking=no',
734733
'-o', 'UserKnownHostsFile={}'.format(os.devnull),

convoy/crypto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def connect_or_exec_ssh_command(
150150
ssh_private_key))
151151
# ensure file mode is set properly for the private key
152152
if not check_ssh_private_key_filemode(ssh_private_key):
153-
raise RuntimeError(
153+
logger.warning(
154154
'SSH private key filemode is too permissive: {}'.format(
155155
ssh_private_key))
156156
# execute SSH command

convoy/misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def tunnel_tensorboard(batch_client, config, jobid, taskid, logdir, image):
7979
('cannot tunnel to remote Tensorboard with non-existant RSA '
8080
'private key: {}').format(ssh_priv_key))
8181
if not crypto.check_ssh_private_key_filemode(ssh_priv_key):
82-
raise RuntimeError(
82+
logger.warning(
8383
'SSH private key filemode is too permissive: {}'.format(
8484
ssh_priv_key))
8585
# populate jobid if empty

0 commit comments

Comments
 (0)