From d6912cf40ee78f78a6eb8921d7ee1c40e6b885dd Mon Sep 17 00:00:00 2001 From: Trishna Guha Date: Mon, 26 Feb 2018 11:21:51 +0530 Subject: [PATCH] nxos_linkagg fix (#36706) Signed-off-by: Trishna Guha --- lib/ansible/modules/network/nxos/nxos_linkagg.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/network/nxos/nxos_linkagg.py b/lib/ansible/modules/network/nxos/nxos_linkagg.py index a5814ca9068..af2e21818c1 100644 --- a/lib/ansible/modules/network/nxos/nxos_linkagg.py +++ b/lib/ansible/modules/network/nxos/nxos_linkagg.py @@ -133,19 +133,21 @@ import re 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 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.network.common.utils import remove_default_spec def execute_show_command(command, module): - provider = module.params['provider'] - if provider['transport'] == 'cli': + device_info = get_capabilities(module) + network_api = device_info.get('network_api', 'nxapi') + + if network_api == 'cliconf': if 'show port-channel summary' in command: command += ' | json' cmds = [command] body = run_commands(module, cmds) - elif provider['transport'] == 'nxapi': + elif network_api == 'nxapi': cmds = [command] body = run_commands(module, cmds)