Skip to content

Commit 9ff03c0

Browse files
committed
fix tox analysis issue
1 parent 452922e commit 9ff03c0

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

SoftLayer/CLI/virt/create_options.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
"""Virtual server order options."""
22
# :license: MIT, see LICENSE for more details.
33
# pylint: disable=too-many-statements
4-
import os
5-
import os.path
6-
74
import click
85

96
import SoftLayer
@@ -128,23 +125,21 @@ def _get_memory_table(create_options):
128125

129126

130127
def _get_os_table(create_options):
131-
os_table = formatting.Table(['os', 'value'], title='Operating Systems')
132-
os_table.sortby = 'os'
128+
os_table = formatting.Table(['KeyName', 'Description'], title='Operating Systems')
129+
os_table.sortby = 'KeyName'
133130
os_table.align = 'l'
134-
op_sys = [o['template']['operatingSystemReferenceCode'] for o in
135-
create_options['operatingSystems']]
136-
137-
op_sys = sorted(op_sys)
138-
os_summary = set()
131+
op_sys = []
132+
for operating_system in create_options['operatingSystems']:
133+
os_option = {
134+
'referenceCode': operating_system['template']['operatingSystemReferenceCode'],
135+
'description': operating_system['itemPrice']['item']['description']
136+
}
137+
op_sys.append(os_option)
139138

140139
for operating_system in op_sys:
141-
os_summary.add(operating_system[0:operating_system.find('_')])
142-
143-
for summary in sorted(os_summary):
144140
os_table.add_row([
145-
summary,
146-
os.linesep.join(sorted([x for x in op_sys
147-
if x[0:len(summary)] == summary]))
141+
operating_system['referenceCode'],
142+
operating_system['description']
148143
])
149144
return os_table
150145

0 commit comments

Comments
 (0)