@@ -39,7 +39,7 @@ def cli(env, identifier, no_vs, no_hardware):
39
39
table .add_row (['firewall' ,
40
40
'Yes' if vlan ['firewallInterfaces' ] else 'No' ])
41
41
subnets = []
42
- for subnet in vlan [ 'subnets' ] :
42
+ for subnet in vlan . get ( 'subnets' , []) :
43
43
subnet_table = formatting .KeyValueTable (['name' , 'value' ])
44
44
subnet_table .align ['name' ] = 'r'
45
45
subnet_table .align ['value' ] = 'l'
@@ -57,7 +57,7 @@ def cli(env, identifier, no_vs, no_hardware):
57
57
server_columns = ['hostname' , 'domain' , 'public_ip' , 'private_ip' ]
58
58
59
59
if not no_vs :
60
- if vlan [ 'virtualGuests' ] :
60
+ if vlan . get ( 'virtualGuests' ) :
61
61
vs_table = formatting .KeyValueTable (server_columns )
62
62
for vsi in vlan ['virtualGuests' ]:
63
63
vs_table .add_row ([vsi ['hostname' ],
@@ -69,7 +69,7 @@ def cli(env, identifier, no_vs, no_hardware):
69
69
table .add_row (['vs' , 'none' ])
70
70
71
71
if not no_hardware :
72
- if vlan [ 'hardware' ] :
72
+ if vlan . get ( 'hardware' ) :
73
73
hw_table = formatting .Table (server_columns )
74
74
for hardware in vlan ['hardware' ]:
75
75
hw_table .add_row ([hardware ['hostname' ],
0 commit comments