mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 22:00:22 -07:00
fixes issue when piping commands through json with output not specifed
There is an issue when piping cli commands through json but the output is specified as either text or the output is none and the transport is cli. The results would not be loaded properly for conditional evaluation. This is similar to #17422
This commit is contained in:
parent
37f721f315
commit
c228dfe692
1 changed files with 2 additions and 0 deletions
|
@ -283,4 +283,6 @@ def prepare_commands(commands):
|
|||
for cmd in to_list(commands):
|
||||
if cmd.output == 'json':
|
||||
cmd.command_string = jsonify(cmd)
|
||||
if cmd.command.endswith('| json'):
|
||||
cmd.output = 'json'
|
||||
yield cmd
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue