Skip to content

Commit 7dbddbf

Browse files
committed
Fix ssh host policy
1 parent 342fbbc commit 7dbddbf

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/sagemaker/modules/train/container_drivers/mpi_utils.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@
1414
from __future__ import absolute_import
1515

1616
import os
17-
import time
1817
import subprocess
19-
18+
import time
2019
from typing import List
2120

22-
from utils import logger, SM_EFA_NCCL_INSTANCES, SM_EFA_RDMA_INSTANCES, get_python_executable
21+
from utils import SM_EFA_NCCL_INSTANCES, SM_EFA_RDMA_INSTANCES, get_python_executable, logger
2322

2423
FINISHED_STATUS_FILE = "/tmp/done.algo-1"
2524
READY_FILE = "/tmp/ready.%s"
@@ -83,7 +82,7 @@ def _can_connect(host: str, port: int = DEFAULT_SSH_PORT) -> bool:
8382
logger.debug("Testing connection to host %s", host)
8483
client = paramiko.SSHClient()
8584
client.load_system_host_keys()
86-
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
85+
client.set_missing_host_key_policy(paramiko.RejectPolicy())
8786
client.connect(host, port=port)
8887
client.close()
8988
logger.info("Can connect to host %s", host)

0 commit comments

Comments
 (0)