@@ -38,20 +38,20 @@ def cli(env, identifier, no_vs, no_hardware):
38
38
table .add_row (['primary_router' ,
39
39
utils .lookup (vlan , 'primaryRouter' , 'fullyQualifiedDomainName' )])
40
40
table .add_row (['Gateway/Firewall' , get_gateway_firewall (vlan )])
41
- subnets = []
42
- for subnet in vlan .get ('subnets' , [] ):
43
- subnet_table = formatting .KeyValueTable (['name ' , 'value ' ])
44
- subnet_table . align [ 'name' ] = 'r'
45
- subnet_table .align [ 'value' ] = 'l'
46
- subnet_table . add_row ([ 'id' , subnet .get ('id' )])
47
- subnet_table . add_row ([ 'identifier' , subnet .get ('networkIdentifier' )])
48
- subnet_table . add_row ([ 'netmask' , subnet .get ('netmask' )])
49
- subnet_table . add_row ([ 'gateway' , subnet .get ('gateway' , formatting . blank ())])
50
- subnet_table . add_row ([ 'type' , subnet .get ('subnetType ' )])
51
- subnet_table . add_row ([ 'usable ips' , subnet . get ( 'usableIpAddressCount' )] )
52
- subnets . append ( subnet_table )
53
-
54
- table .add_row (['subnets' , * subnets ])
41
+
42
+ if vlan .get ('subnets' ):
43
+ subnet_table = formatting .Table (['id ' , 'identifier' , 'netmask' , 'gateway' , 'type' , 'usable ips ' ])
44
+ for subnet in vlan . get ( 'subnets' ):
45
+ subnet_table .add_row ([ subnet . get ( 'id' ),
46
+ subnet .get ('networkIdentifier' ),
47
+ subnet .get ('netmask' ),
48
+ subnet .get ('gateway' ) or formatting . blank (),
49
+ subnet .get ('subnetType' ),
50
+ subnet .get ('usableIpAddressCount ' )])
51
+ # subnets.append(subnet_table )
52
+ table . add_row ([ 'subnets' , subnet_table ] )
53
+ else :
54
+ table .add_row (['subnets' , 'none' ])
55
55
56
56
server_columns = ['hostname' , 'domain' , 'public_ip' , 'private_ip' ]
57
57
@@ -63,7 +63,7 @@ def cli(env, identifier, no_vs, no_hardware):
63
63
vsi .get ('domain' ),
64
64
vsi .get ('primaryIpAddress' ),
65
65
vsi .get ('primaryBackendIpAddress' )])
66
- table .add_row (['vs' , * vs_table ])
66
+ table .add_row (['vs' , vs_table ])
67
67
else :
68
68
table .add_row (['vs' , 'none' ])
69
69
@@ -75,7 +75,7 @@ def cli(env, identifier, no_vs, no_hardware):
75
75
hardware .get ('domain' ),
76
76
hardware .get ('primaryIpAddress' ),
77
77
hardware .get ('primaryBackendIpAddress' )])
78
- table .add_row (['hardware' , * hw_table ])
78
+ table .add_row (['hardware' , hw_table ])
79
79
else :
80
80
table .add_row (['hardware' , 'none' ])
81
81
0 commit comments