Fix nxos_snmp_host bug (#32916)

* Fix nxos_snmp_host bug

* Enable nxos_snmp_host tests
This commit is contained in:
Mike Wiebe 2017-11-16 01:17:42 -05:00 committed by Trishna Guha
commit 208208ab8f
10 changed files with 271 additions and 2 deletions

View file

@ -102,6 +102,7 @@ commands:
'''
import re
from ansible.module_utils.nxos import load_config, run_commands
from ansible.module_utils.nxos import nxos_argument_spec, check_args
from ansible.module_utils.basic import AnsibleModule
@ -173,7 +174,9 @@ def get_snmp_host(host, module):
host_resource = apply_key_map(host_map, each)
if src:
host_resource['src_intf'] = src.split(':')[1].strip()
host_resource['src_intf'] = src
if re.search(r'interface:', src):
host_resource['src_intf'] = src.split(':')[1].strip()
vrf_filt = each.get('TABLE_vrf_filters')
if vrf_filt:
@ -199,7 +202,9 @@ def get_snmp_host(host, module):
host_resource = apply_key_map(host_map_5k, each)
if src:
host_resource['src_intf'] = src.split(':')[1].strip()
host_resource['src_intf'] = src
if re.search(r'interface:', src):
host_resource['src_intf'] = src.split(':')[1].strip()
vrf_filt = each.get('TABLE_filter_vrf')
if vrf_filt: