mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31:39 -05:00
[gcp] Update config.py for safe dir creation (#9645)
Co-authored-by: Richard Liaw <rliaw@berkeley.edu>
This commit is contained in:
parent
b04222dbd9
commit
6fa0edfbef
1 changed files with 4 additions and 0 deletions
|
@ -309,6 +309,10 @@ def _configure_key_pair(config, compute):
|
|||
_create_project_ssh_key_pair(project, public_key, ssh_user,
|
||||
compute)
|
||||
|
||||
# Create the directory if it doesn't exists
|
||||
private_key_dir = os.path.dirname(private_key_path)
|
||||
os.makedirs(private_key_dir, exist_ok=True)
|
||||
|
||||
# We need to make sure to _create_ the file with the right
|
||||
# permissions. In order to do that we need to change the default
|
||||
# os.open behavior to include the mode we want.
|
||||
|
|
Loading…
Add table
Reference in a new issue