@@ -245,15 +245,13 @@ def execute(self, args):
245245 t .add_row (['datacenter' , listing (datacenters , separator = ',' )])
246246
247247 if args ['--cpu' ] or show_all :
248- standard_cpu = filter (
249- lambda x : not x ['template' ].get (
250- 'dedicatedAccountHostOnlyFlag' , False ),
251- result ['processors' ])
248+ standard_cpu = [x for x in result ['processors' ]
249+ if not x ['template' ].get (
250+ 'dedicatedAccountHostOnlyFlag' , False )]
252251
253- ded_cpu = filter (
254- lambda x : x ['template' ].get (
255- 'dedicatedAccountHostOnlyFlag' , False ),
256- result ['processors' ])
252+ ded_cpu = [x for x in result ['processors' ]
253+ if x ['template' ].get ('dedicatedAccountHostOnlyFlag' ,
254+ False )]
257255
258256 def cpus_row (c , name ):
259257 cpus = []
@@ -284,19 +282,16 @@ def cpus_row(c, name):
284282 for summary in sorted (os_summary ):
285283 t .add_row ([
286284 'os (%s)' % summary ,
287- linesep .join (sorted (filter (
288- lambda x : x [0 :len (summary )] == summary , op_sys ))
289- )
285+ linesep .join (sorted ([x for x in op_sys
286+ if x [0 :len (summary )] == summary ]))
290287 ])
291288
292289 if args ['--disk' ] or show_all :
293- local_disks = filter (
294- lambda x : x ['template' ].get ('localDiskFlag' , False ),
295- result ['blockDevices' ])
290+ local_disks = [x for x in result ['blockDevices' ]
291+ if x ['template' ].get ('localDiskFlag' , False )]
296292
297- san_disks = filter (
298- lambda x : not x ['template' ].get ('localDiskFlag' , False ),
299- result ['blockDevices' ])
293+ san_disks = [x for x in result ['blockDevices' ]
294+ if not x ['template' ].get ('localDiskFlag' , False )]
300295
301296 def block_rows (blocks , name ):
302297 simple = {}
@@ -877,7 +872,7 @@ def sync_a_record():
877872 instance ['primaryIpAddress' ],
878873 ttl = args ['--ttl' ])
879874 else :
880- recs = filter ( lambda x : x ['type' ].lower () == 'a' , records )
875+ recs = [ x for x in records if x ['type' ].lower () == 'a' ]
881876 if len (recs ) != 1 :
882877 raise CLIAbort ("Aborting A record sync, found %d "
883878 "A record exists!" % len (recs ))
0 commit comments