Skip to content

Commit cbba4eb

Browse files
caberoscaberos
authored andcommitted
fix the team code review comments
1 parent 9a2752b commit cbba4eb

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

SoftLayer/CLI/loadbal/order.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def order_options(env, datacenter):
9595
data_table.add_row([region['description'].split('-')[0], region['description'].split('-')[1]])
9696
# print(region)
9797
env.fout(data_table)
98-
click.secho("ERROR: Use `slcli lb order-options --datacenter <DC>` "
98+
click.secho("Use `slcli lb order-options --datacenter <DC>` "
9999
"to find pricing information and private subnets for that specific site.")
100100

101101
else:
@@ -105,18 +105,14 @@ def order_options(env, datacenter):
105105
# Skip locations if they are not the one requested.
106106
if datacenter and dc_name != datacenter:
107107
continue
108-
this_table = formatting.Table(
109-
['Prices', 'Private Subnets'],
110-
title="{}: {}".format(region['keyname'], region['description'])
111-
)
112108

113109
l_groups = []
114110
for group in region['location']['location']['groups']:
115111
l_groups.append(group.get('id'))
116112

117113
# Price lookups
118114
prices = []
119-
price_table = formatting.KeyValueTable(['KeyName', 'Cost'])
115+
price_table = formatting.KeyValueTable(['KeyName', 'Cost'], title='Prices')
120116
for item in package['items']:
121117
i_price = {'keyName': item['keyName']}
122118
for price in item.get('prices', []):
@@ -134,7 +130,7 @@ def order_options(env, datacenter):
134130
# Vlan/Subnet Lookups
135131
mask = "mask[networkVlan,podName,addressSpace]"
136132
subnets = net_mgr.list_subnets(datacenter=dc_name, network_space='PRIVATE', mask=mask)
137-
subnet_table = formatting.Table(['Id', 'Subnet', 'Vlan'])
133+
subnet_table = formatting.Table(['Id', 'Subnet', 'Vlan'], title='Private subnet')
138134

139135
for subnet in subnets:
140136
# Only show these types, easier to filter here than in an API call.
@@ -144,9 +140,9 @@ def order_options(env, datacenter):
144140
space = "{}/{}".format(subnet.get('networkIdentifier'), subnet.get('cidr'))
145141
vlan = "{}.{}".format(subnet['podName'], subnet['networkVlan']['vlanNumber'])
146142
subnet_table.add_row([subnet.get('id'), space, vlan])
147-
this_table.add_row([price_table, subnet_table])
148143

149-
env.fout(this_table)
144+
env.fout(price_table)
145+
env.fout(subnet_table)
150146

151147

152148
@click.command()

0 commit comments

Comments
 (0)