fixes pipe issue (#28127)

This commit is contained in:
David Newswanger 2017-08-14 07:51:32 -04:00 committed by Trishna Guha
parent 60ce6438e3
commit cfda267b2b

View file

@ -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'
if command_type == 'cli_show_ascii':
cmds = [{
'command': command,
'output': 'text',
}]
else:
cmds = [command]
body = run_commands(module, cmds)
elif module.params['transport'] == 'nxapi':
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()