Skip to content

Commit 60e4d68

Browse files
caberoscaberos
authored andcommitted
Improve subnet detail
1 parent d19cc48 commit 60e4d68

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

SoftLayer/CLI/subnet/detail.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ 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, networkVlan[networkSpace]]'
29+
mask = 'mask[ipAddresses[id, ipAddress,note], datacenter, virtualGuests, hardware,' \
30+
' networkVlan[networkSpace,primaryRouter]]'
3031

3132
subnet = mgr.get_subnet(subnet_id, mask=mask)
3233

@@ -56,7 +57,9 @@ def cli(env, identifier, no_vs, no_hardware):
5657

5758
ip_table = formatting.KeyValueTable(['id', 'ip', 'note'])
5859
for address in ip_address:
59-
ip_table.add_row([address.get('id'), address.get('ipAddress'), address.get('note')])
60+
ip_table.add_row([address.get('id'),
61+
address.get('ipAddress') + '/' +
62+
subnet['networkVlan']['primaryRouter']['fullyQualifiedDomainName'], address.get('note')])
6063

6164
table.add_row(['ipAddresses', ip_table])
6265

SoftLayer/fixtures/SoftLayer_Network_Subnet.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
'cidr': '26',
99
'subnetType': 'ADDITIONAL_PRIMARY',
1010
'networkVlan': {
11-
'networkSpace': 'PUBLIC'
11+
'networkSpace': 'PUBLIC',
12+
'primaryRouter': {
13+
'fullyQualifiedDomainName': 'fcr03a.dal13.softlayer.com'
14+
}
1215
},
1316
'gateway': '1.2.3.254',
1417
'broadcastAddress': '1.2.3.255',

SoftLayer/managers/network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
'usableIpAddressCount',
3535
'note',
3636
'tagReferences[tag]',
37-
'networkVlan[id,networkSpace]'])
37+
'networkVlan[id,primaryRouter,networkSpace]'])
3838
DEFAULT_VLAN_MASK = ','.join([
3939
'firewallInterfaces',
4040
'hardwareCount',

0 commit comments

Comments
 (0)