Skip to content

Commit a8fad38

Browse files
caberoscaberos
authored andcommitted
fix the team code review comments
1 parent 60e4d68 commit a8fad38

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

SoftLayer/CLI/subnet/detail.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def cli(env, identifier, no_vs, no_hardware):
2626
subnet_id = helpers.resolve_id(mgr.resolve_subnet_ids, identifier,
2727
name='subnet')
2828

29-
mask = 'mask[ipAddresses[id, ipAddress,note], datacenter, virtualGuests, hardware,' \
29+
mask = 'mask[ipAddresses[id, ipAddress,note, hardware, virtualGuest], datacenter, virtualGuests, hardware,' \
3030
' networkVlan[networkSpace,primaryRouter]]'
3131

3232
subnet = mgr.get_subnet(subnet_id, mask=mask)
@@ -57,9 +57,13 @@ def cli(env, identifier, no_vs, no_hardware):
5757

5858
ip_table = formatting.KeyValueTable(['id', 'ip', 'note'])
5959
for address in ip_address:
60+
description = '-'
61+
if address.get('hardware') is not None:
62+
description = address['hardware']['fullyQualifiedDomainName']
63+
elif address.get('virtualGuest') is not None:
64+
description = address['virtualGuest']['fullyQualifiedDomainName']
6065
ip_table.add_row([address.get('id'),
61-
address.get('ipAddress') + '/' +
62-
subnet['networkVlan']['primaryRouter']['fullyQualifiedDomainName'], address.get('note')])
66+
address.get('ipAddress') + '/' + description, address.get('note', '-')])
6367

6468
table.add_row(['ipAddresses', ip_table])
6569

0 commit comments

Comments
 (0)