mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 18:29:08 +08:00
Create ~/.ssh if it doesn't already exist (#9880)
This commit is contained in:
@@ -289,6 +289,10 @@ def _configure_key_pair(config):
|
||||
|
||||
ec2 = _resource("ec2", config)
|
||||
|
||||
# Writing the new ssh key to the filesystem fails if the ~/.ssh
|
||||
# directory doesn't already exist.
|
||||
os.makedirs(os.path.expanduser("~/.ssh"), exist_ok=True)
|
||||
|
||||
# Try a few times to get or create a good key pair.
|
||||
MAX_NUM_KEYS = 30
|
||||
for i in range(MAX_NUM_KEYS):
|
||||
|
||||
@@ -291,6 +291,10 @@ def _configure_key_pair(config, compute):
|
||||
key_found = True
|
||||
break
|
||||
|
||||
# Writing the new ssh key to the filesystem fails if the ~/.ssh
|
||||
# directory doesn't already exist.
|
||||
os.makedirs(os.path.expanduser("~/.ssh"), exist_ok=True)
|
||||
|
||||
# Create a key since it doesn't exist locally or in GCP
|
||||
if not key_found and not os.path.exists(private_key_path):
|
||||
logger.info("_configure_key_pair: "
|
||||
|
||||
Reference in New Issue
Block a user