5353@click .option ('--monthly' , is_flag = True , help = 'Show only monthly instances' )
5454@click .option ('--transient' , help = 'Filter by transient instances' , type = click .BOOL )
5555@click .option ('--hardware' , is_flag = True , default = False , help = 'Show the all VSI related to hardware' )
56- @click .option ('--all' , is_flag = True , default = False , help = 'Show the all VSI and hardware VSIs' )
56+ @click .option ('--all-guests ' , is_flag = True , default = False , help = 'Show the all VSI and hardware VSIs' )
5757@helpers .multi_option ('--tag' , help = 'Filter by tags' )
5858@click .option ('--sortby' ,
5959 help = 'Column to sort by' ,
7171 show_default = True )
7272@environment .pass_env
7373def cli (env , sortby , cpu , domain , datacenter , hostname , memory , network ,
74- hourly , monthly , tag , columns , limit , transient , all , hardware ):
74+ hourly , monthly , tag , columns , limit , transient , hardware , all_guests ):
7575 """List virtual servers."""
7676
7777 vsi = SoftLayer .VSManager (env .client )
@@ -90,22 +90,22 @@ def cli(env, sortby, cpu, domain, datacenter, hostname, memory, network,
9090
9191 table = formatting .Table (columns .columns )
9292 table .sortby = sortby
93- if not hardware or all :
93+ if not hardware or all_guests :
9494 for guest in guests :
9595 table .add_row ([value or formatting .blank ()
9696 for value in columns .row (guest )])
9797
9898 env .fout (table )
9999
100- if hardware or all :
100+ if hardware or all_guests :
101101 hardware_guests = vsi .get_hardware_guests ()
102- for hardware in hardware_guests :
103- if hardware ['virtualHost' ]['guests' ]:
104- title = "Hardware(id = {hardwareId}) guests associated" .format (hardwareId = hardware ['id' ])
102+ for hd_guest in hardware_guests :
103+ if hd_guest ['virtualHost' ]['guests' ]:
104+ title = "Hardware(id = {hardwareId}) guests associated" .format (hardwareId = hd_guest ['id' ])
105105 table_hardware_guest = formatting .Table (['id' , 'hostname' , 'CPU' , 'Memory' , 'Start Date' , 'Status' ,
106106 'powerState' ], title = title )
107107 table_hardware_guest .sortby = 'hostname'
108- for guest in hardware ['virtualHost' ]['guests' ]:
108+ for guest in hd_guest ['virtualHost' ]['guests' ]:
109109 table_hardware_guest .add_row ([
110110 guest ['id' ],
111111 guest ['hostname' ],
0 commit comments