Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nxos_snmp_traps: fix 'group: all' for N35 platforms #55995

Merged
merged 2 commits into from May 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions lib/ansible/modules/network/nxos/nxos_snmp_traps.py
Expand Up @@ -78,9 +78,15 @@

from ansible.module_utils.network.nxos.nxos import load_config, run_commands
from ansible.module_utils.network.nxos.nxos import nxos_argument_spec, check_args
from ansible.module_utils.network.nxos.nxos import get_capabilities
from ansible.module_utils.basic import AnsibleModule


def get_platform_id(module):
info = get_capabilities(module).get('device_info', {})
return (info.get('network_os_platform', ''))


def execute_show_command(command, module):
command = {
'command': command,
Expand Down Expand Up @@ -110,6 +116,11 @@ def get_snmp_traps(group, module):
'rf', 'rmon', 'snmp', 'storm-control', 'stpx',
'switchfabric', 'syslog', 'sysmgr', 'system', 'upgrade',
'vtp']

if 'all' in group and 'N3K-C35' in get_platform_id(module):
module.warn("Platform does not support bfd traps; bfd ignored for 'group: all' request")
feature_list.remove('bfd')

for each in feature_list:
for line in body:
if each == 'ospf':
Expand Down
Expand Up @@ -5,14 +5,14 @@

- name: Setup - Remove snmp_traps if configured
nxos_snmp_traps: &remove
group: all
group: all
provider: "{{ connection }}"
state: disabled

- block:
- name: Configure one snmp trap group
- name: Configure one snmp trap group
nxos_snmp_traps: &config
group: bridge
group: bridge
provider: "{{ connection }}"
state: enabled
register: result
Expand Down Expand Up @@ -60,10 +60,9 @@
- name: Idempotence Check
nxos_snmp_traps: *config1
register: result
when: imagetag is not search("I2|I7|D1")

- assert: *false
when: imagetag is not search("I2|I7|D1")
when: imagetag is not search("I2|I7|D1")

- name: Cleanup
nxos_snmp_traps: *remove
Expand Down