Skip to content

Commit c04bec7

Browse files
author
Nathan Beittenmiller
committed
Removing unnecessary lambda options
1 parent 59fd924 commit c04bec7

2 files changed

Lines changed: 10 additions & 17 deletions

File tree

SoftLayer/CLI/modules/bmetal.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,14 @@ def execute(cls, client, args):
9595
results = cls.get_create_options(bmi_options, 'disk')[0]
9696

9797
t.add_row([results[0], listing(
98-
item[0] for item in sorted(results[1],
99-
key=lambda x: int(x[0])))])
98+
item[0] for item in sorted(results[1]))])
10099

101100
if args['--nic'] or show_all:
102101
results = cls.get_create_options(bmi_options, 'nic')
103102

104103
for result in results:
105104
t.add_row([result[0], listing(
106-
item[0] for item in sorted(result[1],
107-
key=lambda x: x[0]))])
105+
item[0] for item in sorted(result[1],))])
108106

109107
return t
110108

@@ -257,10 +255,10 @@ def _generate_windows_code(description):
257255

258256
for item in bmi_options['categories']['port_speed']['items']:
259257
if 'dual' in item['description'].lower():
260-
dual.append((str(item['capacity']) + '_DUAL',
258+
dual.append((str(int(item['capacity'])) + '_DUAL',
261259
item['price_id']))
262260
else:
263-
single.append((item['capacity'], item['price_id']))
261+
single.append((int(item['capacity']), item['price_id']))
264262

265263
return [('single nic', single), ('dual nic', dual)]
266264

SoftLayer/CLI/modules/hardware.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -364,17 +364,15 @@ def execute(cls, client, args):
364364
if args['--cpu'] or show_all:
365365
results = cls.get_create_options(ds_options, 'cpu')
366366

367-
for result in results:
367+
for result in sorted(results):
368368
t.add_row([result[0], listing(
369-
item[0] for item in sorted(result[1],
370-
key=lambda x: x[0]))])
369+
item[0] for item in sorted(result[1]))])
371370

372371
if args['--memory'] or show_all:
373372
results = cls.get_create_options(ds_options, 'memory')[0]
374373

375374
t.add_row([results[0], listing(
376-
item[0] for item in sorted(results[1],
377-
key=lambda x: int(x[0])))])
375+
item[0] for item in sorted(results[1]))])
378376

379377
if args['--os'] or show_all:
380378
results = cls.get_create_options(ds_options, 'os')
@@ -387,23 +385,20 @@ def execute(cls, client, args):
387385
results = cls.get_create_options(ds_options, 'disk')[0]
388386

389387
t.add_row([results[0], linesep.join(
390-
item[0] for item in sorted(results[1],
391-
key=lambda x: x[0]))])
388+
item[0] for item in sorted(results[1],))])
392389

393390
if args['--nic'] or show_all:
394391
results = cls.get_create_options(ds_options, 'nic')
395392

396393
for result in results:
397394
t.add_row([result[0], listing(
398-
item[0] for item in sorted(result[1],
399-
key=lambda x: x[0]))])
395+
item[0] for item in sorted(result[1],))])
400396

401397
if args['--controller'] or show_all:
402398
results = cls.get_create_options(ds_options, 'disk_controller')[0]
403399

404400
t.add_row([results[0], listing(
405-
item[0] for item in sorted(results[1],
406-
key=lambda x: x[0]))])
401+
item[0] for item in sorted(results[1],))])
407402

408403
return t
409404

0 commit comments

Comments
 (0)