mirror of
https://github.com/ansible/awx.git
synced 2026-05-13 04:17:36 -02:30
cli: fix a bug when printing complex data structures w/ -f human
see: https://github.com/ansible/awx/issues/4567
This commit is contained in:
@@ -140,7 +140,7 @@ def format_human(output, fmt):
|
|||||||
lines = []
|
lines = []
|
||||||
if fmt == '.':
|
if fmt == '.':
|
||||||
fmt = 'id,name'
|
fmt = 'id,name'
|
||||||
column_names = fmt.split(',')
|
column_names = [col.strip() for col in fmt.split(',')]
|
||||||
if 'count' in output:
|
if 'count' in output:
|
||||||
output = output['results']
|
output = output['results']
|
||||||
else:
|
else:
|
||||||
@@ -163,6 +163,8 @@ def format_human(output, fmt):
|
|||||||
try:
|
try:
|
||||||
return locale.format("%.*f", (0, int(v)), True)
|
return locale.format("%.*f", (0, int(v)), True)
|
||||||
except (ValueError, TypeError):
|
except (ValueError, TypeError):
|
||||||
|
if not isinstance(v, six.text_type):
|
||||||
|
return str(v)
|
||||||
return v
|
return v
|
||||||
|
|
||||||
# calculate the max width of each column
|
# calculate the max width of each column
|
||||||
|
|||||||
Reference in New Issue
Block a user