Skip to content

Commit c4bded1

Browse files
committedAug 9, 2024·
Improved the formatting of hardware details page. Fixed #2153
1 parent f83fc2f commit c4bded1

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed
 

‎SoftLayer/CLI/hardware/detail.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,13 @@ def _bw_table(bw_data):
173173

174174

175175
def _system_table(system_data):
176-
table = formatting.Table(['Type', 'name'])
176+
table = formatting.Table(['Type', 'Name'])
177+
table.align['Type'] = 'r'
178+
table.align['Name'] = 'l'
179+
table.sortby = 'Type'
177180
for system in system_data:
178-
table.add_row([utils.lookup(system, 'hardwareComponentModel',
179-
'hardwareGenericComponentModel',
180-
'hardwareComponentType', 'keyName'),
181-
utils.lookup(system, 'hardwareComponentModel', 'longDescription')])
181+
c_type = utils.lookup(system, 'hardwareComponentModel', 'hardwareGenericComponentModel',
182+
'hardwareComponentType', 'keyName')
183+
c_name = utils.lookup(system, 'hardwareComponentModel', 'longDescription')
184+
table.add_row([c_type, c_name])
182185
return table

0 commit comments

Comments
 (0)
Please sign in to comment.