mirror of
https://github.com/ansible/awx.git
synced 2026-05-14 12:57:40 -02:30
add special code for formatting metrics and settings with -f human
see: https://github.com/ansible/awx/issues/4566
This commit is contained in:
@@ -167,10 +167,23 @@ def parse_resource(client, skip_deprecated=False):
|
||||
command = CustomCommand.registry[resource]()
|
||||
response = command.handle(client, parser)
|
||||
if response:
|
||||
_filter = client.get_config('filter')
|
||||
if (
|
||||
resource == 'config' and
|
||||
client.get_config('format') == 'human'
|
||||
):
|
||||
response = {
|
||||
'count': len(response),
|
||||
'results': [
|
||||
{'key': k, 'value': v}
|
||||
for k, v in response.items()
|
||||
]
|
||||
}
|
||||
_filter = 'key, value'
|
||||
formatted = format_response(
|
||||
Page.from_json(response),
|
||||
fmt=client.get_config('format'),
|
||||
filter=client.get_config('filter'),
|
||||
filter=_filter
|
||||
)
|
||||
print(formatted)
|
||||
raise SystemExit()
|
||||
|
||||
Reference in New Issue
Block a user