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:
Peter Sprygada 2016-09-06 16:55:53 -04:00
commit c228dfe692

View file

@ -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