File tree 2 files changed +8
-2
lines changed
src/ibm_ray_config/modules/gen2
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
1
[metadata]
2
2
name = ibm-ray-config
3
- version = 1.0.0b28
3
+ version = 1.0.0b30
4
4
author = Omer J Cohen
5
5
6
6
description = Interactive tool generating ray configuration for IBM platforms
Original file line number Diff line number Diff line change 10
10
validate_exists , validate_not_empty , free_dialog )
11
11
12
12
from ibm_cloud_sdk_core import ApiException
13
- DEFAULT_KEY_NAME = f'ray-{ os .environ .get ("USERNAME " )} -{ str (uuid4 ())[:5 ]} '
13
+ DEFAULT_KEY_NAME = f'ray-{ os .environ .get ("USER " )} -{ str (uuid4 ())[:5 ]} '
14
14
15
15
def generate_keypair ():
16
16
"""Returns newly generated public ssh-key's contents and private key's path"""
17
+ global DEFAULT_KEY_NAME
18
+ # if no USER env exists, replace the None received by os.environ.get("USER")
19
+ # with a valid string name for a key on ibm vpc platform
20
+ if "None" in DEFAULT_KEY_NAME :
21
+ DEFAULT_KEY_NAME = DEFAULT_KEY_NAME .replace ("None" , "autogen" )
22
+
17
23
filename = f"{ os .sep } tmp{ os .sep } { DEFAULT_KEY_NAME } "
18
24
19
25
os .system (f'ssh-keygen -b 2048 -t rsa -f { filename } -q -N ""' )
You can’t perform that action at this time.
0 commit comments