mirror of
https://github.com/ansible/awx.git
synced 2026-01-09 23:12:08 -03:30
Merge pull request #4593 from ryanpetrello/fix-4567
cli: fix a bug when printing complex data structures w/ -f human
Reviewed-by: Elijah DeLee <kdelee@redhat.com>
https://github.com/kdelee
This commit is contained in:
commit
7dd6306221
@ -140,7 +140,7 @@ def format_human(output, fmt):
|
||||
lines = []
|
||||
if fmt == '.':
|
||||
fmt = 'id,name'
|
||||
column_names = fmt.split(',')
|
||||
column_names = [col.strip() for col in fmt.split(',')]
|
||||
if 'count' in output:
|
||||
output = output['results']
|
||||
else:
|
||||
@ -163,6 +163,8 @@ def format_human(output, fmt):
|
||||
try:
|
||||
return locale.format("%.*f", (0, int(v)), True)
|
||||
except (ValueError, TypeError):
|
||||
if not isinstance(v, six.text_type):
|
||||
return str(v)
|
||||
return v
|
||||
|
||||
# calculate the max width of each column
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user