mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Fix nxos_snmp_host bug (#32916)
* Fix nxos_snmp_host bug * Enable nxos_snmp_host tests
This commit is contained in:
parent
3f3c526026
commit
208208ab8f
10 changed files with 271 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue