diff --git a/lib/ansible/module_utils/eos.py b/lib/ansible/module_utils/eos.py index c678a960d33..0fba65c1e75 100644 --- a/lib/ansible/module_utils/eos.py +++ b/lib/ansible/module_utils/eos.py @@ -317,7 +317,7 @@ def prepare_commands(commands): jsonify = lambda x: '%s | json' % x for item in to_list(commands): if item.output == 'json': - cmd = jsonify(cmd) + cmd = jsonify(item) elif item.command.endswith('| json'): item.output = 'json' cmd = str(item)