From cfda267b2b1010bbef3e37d5cb41e1470f211197 Mon Sep 17 00:00:00 2001 From: David Newswanger Date: Mon, 14 Aug 2017 07:51:32 -0400 Subject: [PATCH] fixes pipe issue (#28127) --- .../modules/network/nxos/nxos_igmp_interface.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/ansible/modules/network/nxos/nxos_igmp_interface.py b/lib/ansible/modules/network/nxos/nxos_igmp_interface.py index 1c448d527ba..b045af95272 100644 --- a/lib/ansible/modules/network/nxos/nxos_igmp_interface.py +++ b/lib/ansible/modules/network/nxos/nxos_igmp_interface.py @@ -242,15 +242,15 @@ from ansible.module_utils.basic import AnsibleModule import re def execute_show_command(command, module, command_type='cli_show'): - if module.params['transport'] == 'cli': - command += ' | json' - cmds = [command] - body = run_commands(module, cmds) - elif module.params['transport'] == 'nxapi': + if command_type == 'cli_show_ascii': + cmds = [{ + 'command': command, + 'output': 'text', + }] + else: cmds = [command] - body = run_commands(module, cmds) - return body + return run_commands(module, cmds) def get_interface_mode(interface, intf_type, module): @@ -695,4 +695,3 @@ def main(): if __name__ == '__main__': main() -