Handle nxos_feature issue where json isn't supported (#39150)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
pull/39723/head
Trishna Guha 6 years ago committed by GitHub
parent 9348809184
commit 9eff1f1d74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -72,6 +72,7 @@ commands:
import re
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.connection import ConnectionError
from ansible.module_utils.network.nxos.nxos import load_config, run_commands
from ansible.module_utils.network.nxos.nxos import get_capabilities, nxos_argument_spec
@ -130,8 +131,13 @@ def validate_feature(module, mode='show'):
how they are configured'''
feature = module.params['feature']
info = get_capabilities(module).get('device_info', {})
os_version = info.get('network_os_version', '')
try:
info = get_capabilities(module)
device_info = info.get('device_info', {})
os_version = device_info.get('network_os_version', '')
except ConnectionError:
os_version = ''
if '8.1' in os_version:
feature_to_be_mapped = {

Loading…
Cancel
Save