fixes pipe issue (#28127)
This commit is contained in:
parent
60ce6438e3
commit
cfda267b2b
1 changed files with 7 additions and 8 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue