mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
fixes issue introduced with raw kwarg (#17728)
The raw kwarg was added to return raw output from devices with if the attempt to convert to json failed. The change was causing all json output to be returned raw. This fixes that issue.
This commit is contained in:
parent
530b2d7a15
commit
aa1e3ef2b5
1 changed files with 2 additions and 1 deletions
|
@ -269,7 +269,8 @@ class Cli(NxapiConfigMixin, CliBase):
|
|||
cmds = list(prepare_commands(commands))
|
||||
responses = self.execute(cmds)
|
||||
for index, cmd in enumerate(commands):
|
||||
if cmd.output == 'json' and cmd.args.get('raw') is False:
|
||||
raw = cmd.args.get('raw') or False
|
||||
if cmd.output == 'json' and not raw:
|
||||
try:
|
||||
responses[index] = json.loads(responses[index])
|
||||
except ValueError:
|
||||
|
|
Loading…
Add table
Reference in a new issue