Skip to content

Commit b325965

Browse files
committed
reorder tool's output
1 parent 688bb4f commit b325965

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = ibm-ray-config
3-
version = 1.0.0b26
3+
version = 1.0.0b27
44
author = Omer J Cohen
55
author_email = [email protected]
66
description = Interactive tool generating ray configuration for IBM platforms

src/ibm_ray_config/main.py

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def validate_api_keys(base_config, modules, iam_api_key, compute_iam_endpoint):
5353

5454
@click.command()
5555
@click.option('--output-folder', '-o', help='Output folder to save configurations')
56-
# @click.option('--input-file', '-i', help=f'Template for the new configuration')
5756
@click.option('--iam-api-key', '-a', help='IAM_API_KEY')
5857
@click.option('--version', '-v', help=f'Get package version', is_flag=True)
5958
@click.option('--compute-iam-endpoint', help='IAM endpoint url used for compute instead of default https://iam.cloud.ibm.com')

src/ibm_ray_config/modules/gen2/ray/vpc.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def _create_vpc_peripherals(self, ibm_vpc_client, vpc_obj, zone_obj, resource_gr
294294
ibm_vpc_client.set_subnet_public_gateway(
295295
subnet_id, {'id': gateway_id})
296296

297-
print(color_msg(f"VPC subnet {subnet_prototype['name']} been created and attached to gateway", color=Color.LIGHTGREEN))
297+
print(color_msg(f"VPC subnet {subnet_prototype['name']} been created and attached to gateway\n", color=Color.LIGHTGREEN))
298298

299299
# Update security group to have all required rules
300300
sg_id = vpc_obj['default_security_group']['id']
@@ -321,7 +321,7 @@ def _create_vpc_peripherals(self, ibm_vpc_client, vpc_obj, zone_obj, resource_gr
321321
res = ibm_vpc_client.create_security_group_rule(
322322
sg_id, sg_rule_prototype).get_result()
323323

324-
print(color_msg(f"Security group {sg_name} been updated with required rules", color=Color.LIGHTGREEN))
324+
print(color_msg(f"Security group {sg_name} been updated with required rules\n", color=Color.LIGHTGREEN))
325325

326326
def create_public_gateway(self, vpc_obj, zone_obj, resource_group, subnet_name):
327327
vpc_id = vpc_obj['id']
@@ -410,7 +410,7 @@ def list_vpcs():
410410
# Create a new VPC
411411
if not vpc_name:
412412
resource_group_id = self._select_resource_group()
413-
print(color_msg(f"Using resource group id: {resource_group_id}",color=Color.LIGHTGREEN))
413+
print(color_msg(f"Using resource group id: {resource_group_id}\n",color=Color.LIGHTGREEN))
414414
resource_group = {'id': resource_group_id}
415415

416416
vpc_obj = self._create_vpc(ibm_vpc_client, resource_group)

src/ibm_ray_config/modules/gen2/ssh_key.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def generate_keypair():
1717
filename = f"{os.sep}tmp{os.sep}{DEFAULT_KEY_NAME}"
1818

1919
os.system(f'ssh-keygen -b 2048 -t rsa -f {filename} -q -N ""')
20-
print(f"\n\n\033[92mSSH key pair been generated\n")
20+
print(color_msg("SSH key pair been generated",Color.LIGHTGREEN))
2121
print(f"private key intermediate location: {os.path.abspath(filename)}")
2222
print(f"public key intermediate location: {os.path.abspath(filename)}.pub\033[0m")
2323
with open(f"{filename}.pub", 'r') as file:
@@ -93,7 +93,7 @@ def register_ssh_key(ibm_vpc_client, config, auto=False):
9393
print(color_msg("Can't register an SSH key with the same fingerprint",Color.RED))
9494
exit(1) # can't continue the configuration process without a valid ssh key
9595

96-
print(f"\033[92mnew SSH key: '{keyname}' been registered in vpc\033[0m")
96+
print(color_msg(f"new SSH key '{keyname}' been registered in vpc\n", Color.LIGHTGREEN))
9797

9898
result = response.get_result()
9999
return result['name'], result['id'], private_ssh_key_path
@@ -197,7 +197,7 @@ def is_pair(id, ssh_key_filename):
197197
ssh_key_data = subprocess.getoutput([f"ssh-keygen -y -f {self.defaults['ssh_key_filename']} | cut -d' ' -f 2"])
198198
response = self.ibm_vpc_client.create_key(public_key=ssh_key_data, name=default_keyname, resource_group={
199199
"id": resource_group_id}, type='rsa')
200-
print(f"\033[92mnew SSH key {default_keyname} been registered in vpc\033[0m")
200+
print(color_msg(f"new SSH key {default_keyname} been registered in vpc\n", Color.LIGHTGREEN))
201201
result = response.get_result()
202202
return result['id'], self.defaults['ssh_key_filename'], 'root'
203203
else:

0 commit comments

Comments
 (0)