mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
nxos_linkagg fix (#36706)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
parent
5a6b893240
commit
d6912cf40e
1 changed files with 6 additions and 4 deletions
|
@ -133,19 +133,21 @@ import re
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
|
||||||
from ansible.module_utils.network.nxos.nxos import get_config, load_config, run_commands
|
from ansible.module_utils.network.nxos.nxos import get_config, load_config, run_commands
|
||||||
from ansible.module_utils.network.nxos.nxos import nxos_argument_spec
|
from ansible.module_utils.network.nxos.nxos import get_capabilities, nxos_argument_spec
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible.module_utils.network.common.utils import remove_default_spec
|
from ansible.module_utils.network.common.utils import remove_default_spec
|
||||||
|
|
||||||
|
|
||||||
def execute_show_command(command, module):
|
def execute_show_command(command, module):
|
||||||
provider = module.params['provider']
|
device_info = get_capabilities(module)
|
||||||
if provider['transport'] == 'cli':
|
network_api = device_info.get('network_api', 'nxapi')
|
||||||
|
|
||||||
|
if network_api == 'cliconf':
|
||||||
if 'show port-channel summary' in command:
|
if 'show port-channel summary' in command:
|
||||||
command += ' | json'
|
command += ' | json'
|
||||||
cmds = [command]
|
cmds = [command]
|
||||||
body = run_commands(module, cmds)
|
body = run_commands(module, cmds)
|
||||||
elif provider['transport'] == 'nxapi':
|
elif network_api == 'nxapi':
|
||||||
cmds = [command]
|
cmds = [command]
|
||||||
body = run_commands(module, cmds)
|
body = run_commands(module, cmds)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue