Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 25, 2023
1 parent 0d4a15c commit d8afa40
Show file tree
Hide file tree
Showing 7 changed files with 4,239 additions and 313 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Name | Description
[cisco.ios.ios_prefix_lists](https://github.com/ansible-collections/cisco.ios/blob/main/docs/cisco.ios.ios_prefix_lists_module.rst)|Resource module to configure prefix lists.
[cisco.ios.ios_route_maps](https://github.com/ansible-collections/cisco.ios/blob/main/docs/cisco.ios.ios_route_maps_module.rst)|Resource module to configure route maps.
[cisco.ios.ios_service](https://github.com/ansible-collections/cisco.ios/blob/main/docs/cisco.ios.ios_service_module.rst)|Resource module to configure service.
[cisco.ios.ios_snmp_server](https://github.com/ansible-collections/cisco.ios/blob/main/docs/cisco.ios.ios_snmp_server_module.rst)|Resource module to configure snmp server.
[cisco.ios.ios_snmp_server](https://github.com/ansible-collections/cisco.ios/blob/main/docs/cisco.ios.ios_snmp_server_module.rst)|Resource module to configure snmp server
[cisco.ios.ios_static_routes](https://github.com/ansible-collections/cisco.ios/blob/main/docs/cisco.ios.ios_static_routes_module.rst)|Resource module to configure static routes.
[cisco.ios.ios_system](https://github.com/ansible-collections/cisco.ios/blob/main/docs/cisco.ios.ios_system_module.rst)|Module to manage the system attributes.
[cisco.ios.ios_user](https://github.com/ansible-collections/cisco.ios/blob/main/docs/cisco.ios.ios_user_module.rst)|Module to manage the aggregates of local users.
Expand Down
4,441 changes: 4,182 additions & 259 deletions docs/cisco.ios.ios_snmp_server_module.rst

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions plugins/module_utils/network/ios/argspec/snmp_server/snmp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from __future__ import absolute_import, division, print_function


__metaclass__ = type

#############################################
Expand All @@ -18,19 +19,18 @@
#
# To update the argspec make the desired changes
# in the documentation in the module file and re-run
# ansible.content_builder commenting out
# ansible.content_builder commenting out
# the path to external 'docstring' in build.yaml.
#
##############################################
##############################################

"""
The arg spec for the ios_snmp_server module
"""


class Snmp_serverArgs(object): # pylint: disable=R0903
"""The arg spec for the ios_snmp_server module
"""
"""The arg spec for the ios_snmp_server module"""

argument_spec = {
"config": {
Expand Down Expand Up @@ -488,7 +488,7 @@ class Snmp_serverArgs(object): # pylint: disable=R0903
"enable": {"type": "bool"},
"illegal_label": {"type": "bool"},
"max_thresh_cleared": {
"type": "bool"
"type": "bool",
},
"max_threshold": {"type": "bool"},
"mid_threshold": {"type": "bool"},
Expand All @@ -497,7 +497,7 @@ class Snmp_serverArgs(object): # pylint: disable=R0903
},
"type": "dict",
},
}
},
},
"traffic_eng": {
"options": {
Expand Down Expand Up @@ -566,15 +566,15 @@ class Snmp_serverArgs(object): # pylint: disable=R0903
"state_change": {
"options": {
"nssa_trans_change": {
"type": "bool"
"type": "bool",
},
"shamlink": {
"options": {
"interface": {
"type": "bool"
"type": "bool",
},
"neighbor": {
"type": "bool"
"type": "bool",
},
},
"type": "dict",
Expand Down Expand Up @@ -610,19 +610,19 @@ class Snmp_serverArgs(object): # pylint: disable=R0903
"enable": {"type": "bool"},
"if_state_change": {"type": "bool"},
"neighbor_restart_helper_status_change": {
"type": "bool"
"type": "bool",
},
"neighbor_state_change": {"type": "bool"},
"nssa_translator_status_change": {
"type": "bool"
"type": "bool",
},
"restart_status_change": {"type": "bool"},
"virtif_state_change": {"type": "bool"},
"virtneighbor_restart_helper_status_change": {
"type": "bool"
"type": "bool",
},
"virtneighbor_state_change": {
"type": "bool"
"type": "bool",
},
},
"type": "dict",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __init__(self, module):
"password_policy",
"users",
"views",
#"traps.power_ethernet.group",
# "traps.power_ethernet.group",
]
self.complex_parsers = [
"traps.aaa_server",
Expand Down Expand Up @@ -292,7 +292,8 @@ def _snmp_list_to_dict(self, data):
tmp_data[k]["protocol"] = tmp
elif k == "groups":
tmp_data[k] = {
str(i[p_key.get(k)] + i.get("version_option", "") + i.get("context", "")): i for i in tmp_data[k]
str(i[p_key.get(k)] + i.get("version_option", "") + i.get("context", "")): i
for i in tmp_data[k]
}
elif k == "views":
tmp_data[k] = {
Expand Down
44 changes: 22 additions & 22 deletions plugins/module_utils/network/ios/rm_templates/snmp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def __init__(self, lines=None, module=None):
"command": "{{ command }}",
},
},
},
},
{
"name": "cache",
"getval": re.compile(
Expand Down Expand Up @@ -624,7 +624,7 @@ def __init__(self, lines=None, module=None):
{
"name": "traps.auth_framework",
"getval": re.compile(
r"""
r"""
^snmp-server\senable\straps\sauth-framework
(\s(?P<sec_violation>sec-violation))?
""", re.VERBOSE,
Expand All @@ -636,8 +636,8 @@ def __init__(self, lines=None, module=None):
"auth_framework": {
"enable": True,
"sec_violation": "{{ not not sec_violation }}",
},
},
},
},
},
},
{
Expand Down Expand Up @@ -834,16 +834,16 @@ def __init__(self, lines=None, module=None):
{
"name": "traps.config",
"getval": re.compile(
r"""
r"""
^snmp-server\senable\straps\sconfig\s*$
""", re.VERBOSE,
),
"setval": "snmp-server enable traps config",
"result": {
"traps": {
"config": True,
},
},
},
},
},
{
"name": "traps.config_copy",
Expand All @@ -856,7 +856,7 @@ def __init__(self, lines=None, module=None):
"result": {
"traps": {
"config_copy": True,
}
},
},
},
{
Expand Down Expand Up @@ -997,7 +997,7 @@ def __init__(self, lines=None, module=None):
"scheduled_test_fail": "{{ not not scheduled_test_fail }}",
},
},
}
},
},
{
# entity-perf throughput-notif
Expand Down Expand Up @@ -1773,7 +1773,7 @@ def __init__(self, lines=None, module=None):
"{{ ' session-down' if traps.mpls.ldp.session_down|d(False) else '' }}"
"{{ ' session-up' if traps.mpls.ldp.session_up|d(False) else '' }}"
"{{ ' threshold' if traps.mpls.ldp.threshold|d(False) else '' }}",
"result": {
"result": {
"traps": {
"mpls": {
"ldp": {
Expand Down Expand Up @@ -1803,7 +1803,7 @@ def __init__(self, lines=None, module=None):
"{{ ' session-down' if traps.mpls.rfc.ldp.session_down|d(False) else '' }}"
"{{ ' session-up' if traps.mpls.rfc.ldp.session_up|d(False) else '' }}"
"{{ ' threshold' if traps.mpls.rfc.ldp.threshold|d(False) else '' }}",
"result": {
"result": {
"traps": {
"mpls": {
"rfc": {
Expand Down Expand Up @@ -1835,7 +1835,7 @@ def __init__(self, lines=None, module=None):
"{{ ' reoptimized' traps.mpls.rfc.traffic_eng.reoptimized|d(False) else '' }}"
"{{ ' reroute' traps.mpls.rfc.traffic_eng.reroute|d(False) else '' }}"
"{{ ' up' traps.mpls.rfc.traffic_eng.up|d(False) else '' }}",
"result": {
"result": {
"traps": {
"mpls": {
"rfc": {
Expand Down Expand Up @@ -1871,7 +1871,7 @@ def __init__(self, lines=None, module=None):
"{{ ' mid-threshold' if traps.mpls.rfc.vpn.mid_threshold|d(False) else '' }}"
"{{ ' vrf-down' if traps.mpls.rfc.vpn.vrf_down|d(False) else '' }}"
"{{ ' vrf-up' if traps.mpls.rfc.vpn.vrf_up|d(False) else '' }}",
"result": {
"result": {
"traps": {
"mpls": {
"rfc": {
Expand Down Expand Up @@ -2294,7 +2294,7 @@ def __init__(self, lines=None, module=None):
(\s(?P<rate_limit>[0-9]+))?
""", re.VERBOSE,
),
"setval": "snmp-server enable traps ospfv3 rate_limit"
"setval": "snmp-server enable traps ospfv3 rate_limit"
"{{ traps.ospfv3.rate_limit|int if traps.ospfv3.rate_limit|int > 0 else '' }}",
"result": {
"traps": {
Expand Down Expand Up @@ -2343,7 +2343,7 @@ def __init__(self, lines=None, module=None):
},
},
},
}
},
},
{
"name": "traps.pim",
Expand Down Expand Up @@ -2573,7 +2573,7 @@ def __init__(self, lines=None, module=None):
r"""
^snmp-server\senable\straps\sstpx
(\s(?P<inconsistency>inconsistency))?
(\s(?P<root_inconsistency>root-inconsistency))?
(\s(?P<root_inconsistency>root-inconsistency))?
(\s(?P<loop_inconsistency>loop-inconsistency))?
""", re.VERBOSE,
),
Expand Down Expand Up @@ -2652,15 +2652,15 @@ def __init__(self, lines=None, module=None):
"random_number_fail": "{{ not not random_number_fail }}",
"src_entropy_fail": "{{ not not src_entropy_fail }}",
},
}
},
},
},
{
"name": "traps.trustsec_interface",
"getval": re.compile(
r"""
^snmp-server\senable\straps\strustsec-interface
(\s(?P<unauthorized>unauthorized))?
(\s(?P<unauthorized>unauthorized))?
(\s(?P<sap_fail>sap-fail))?
(\s(?P<authc_fail>authc-fail))?
(\s(?P<supplicant_fail>supplicant-fail))?
Expand All @@ -2683,7 +2683,7 @@ def __init__(self, lines=None, module=None):
"supplicant_fail": "{{ not not supplicant_fail }}",
"authz_fail": "{{ not not authz_fail }}",
},
}
},
},
},
{
Expand All @@ -2705,7 +2705,7 @@ def __init__(self, lines=None, module=None):
"peer_policy_updated": "{{ not not peer_policy_updated }}",
"authz_sgacl_fail": "{{ not not authz_sgacl_fail }}",
},
}
},
},
},
{
Expand All @@ -2727,7 +2727,7 @@ def __init__(self, lines=None, module=None):
"radius_server": "{{ not not radius_server }}",
"provision_secret": "{{ not not provision_secret }}",
},
}
},
},
},
{
Expand Down Expand Up @@ -2770,7 +2770,7 @@ def __init__(self, lines=None, module=None):
"oper_nodeid_change": "{{ not not oper_nodeid_change }}",
"binding_conflict": "{{ not not binding_conflict }}",
},
}
},
},
},
{
Expand Down
Loading

0 comments on commit d8afa40

Please sign in to comment.