@@ -39,7 +39,7 @@ def cli(env, identifier, no_vs, no_hardware):
3939 table .add_row (['firewall' ,
4040 'Yes' if vlan ['firewallInterfaces' ] else 'No' ])
4141 subnets = []
42- for subnet in vlan [ 'subnets' ] :
42+ for subnet in vlan . get ( 'subnets' , []) :
4343 subnet_table = formatting .KeyValueTable (['name' , 'value' ])
4444 subnet_table .align ['name' ] = 'r'
4545 subnet_table .align ['value' ] = 'l'
@@ -57,7 +57,7 @@ def cli(env, identifier, no_vs, no_hardware):
5757 server_columns = ['hostname' , 'domain' , 'public_ip' , 'private_ip' ]
5858
5959 if not no_vs :
60- if vlan [ 'virtualGuests' ] :
60+ if vlan . get ( 'virtualGuests' ) :
6161 vs_table = formatting .KeyValueTable (server_columns )
6262 for vsi in vlan ['virtualGuests' ]:
6363 vs_table .add_row ([vsi ['hostname' ],
@@ -69,7 +69,7 @@ def cli(env, identifier, no_vs, no_hardware):
6969 table .add_row (['vs' , 'none' ])
7070
7171 if not no_hardware :
72- if vlan [ 'hardware' ] :
72+ if vlan . get ( 'hardware' ) :
7373 hw_table = formatting .Table (server_columns )
7474 for hardware in vlan ['hardware' ]:
7575 hw_table .add_row ([hardware ['hostname' ],
0 commit comments