Do not fail on SSH private key filemode check

- Always failing prevents execution on WSL
- Log warning instead
This commit is contained in:
Fred Park 2017-11-08 09:47:35 -08:00
Родитель f48c0ea6e6
Коммит fc362262da
3 изменённых файлов: 4 добавлений и 5 удалений

Просмотреть файл

@ -726,9 +726,8 @@ def generate_ssh_tunnel_script(batch_client, pool, ssh_priv_key, nodes):
return
if not crypto.check_ssh_private_key_filemode(ssh_priv_key):
logger.warning(
('cannot generate tunnel script with private SSH key that '
'is too permissive: {}').format(ssh_priv_key))
return
'SSH private key filemode is too permissive: {}'.format(
ssh_priv_key))
ssh_args = [
'ssh', '-o', 'StrictHostKeyChecking=no',
'-o', 'UserKnownHostsFile={}'.format(os.devnull),

Просмотреть файл

@ -150,7 +150,7 @@ def connect_or_exec_ssh_command(
ssh_private_key))
# ensure file mode is set properly for the private key
if not check_ssh_private_key_filemode(ssh_private_key):
raise RuntimeError(
logger.warning(
'SSH private key filemode is too permissive: {}'.format(
ssh_private_key))
# execute SSH command

Просмотреть файл

@ -79,7 +79,7 @@ def tunnel_tensorboard(batch_client, config, jobid, taskid, logdir, image):
('cannot tunnel to remote Tensorboard with non-existant RSA '
'private key: {}').format(ssh_priv_key))
if not crypto.check_ssh_private_key_filemode(ssh_priv_key):
raise RuntimeError(
logger.warning(
'SSH private key filemode is too permissive: {}'.format(
ssh_priv_key))
# populate jobid if empty