Skip to content

Commit e8c6d9c

Browse files
caberoscaberos
authored andcommitted
fix the call api cannot handle empty results
1 parent 373a53a commit e8c6d9c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

SoftLayer/CLI/formatting.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,19 @@ def _format_dict(result):
400400
table.align['value'] = 'l'
401401

402402
for key, value in result.items():
403-
value = iter_to_table(value)
404-
table.add_row([key, value])
405403

404+
table_list = Table(['value'])
405+
print(str(value))
406+
if str(value) == "[[], [], []]":
407+
for item in value:
408+
if str(item) == '[]':
409+
table_list.add_row(['empty'])
410+
else:
411+
table_list.add_row(item)
412+
table.add_row([key, table_list])
413+
else:
414+
value = iter_to_table(value)
415+
table.add_row([key, value])
406416
return table
407417

408418

0 commit comments

Comments
 (0)