summaryrefslogtreecommitdiff
path: root/plugins/module_utils
diff options
context:
space:
mode:
authorGaige B Paulsen <gaige@cluetrust.com>2024-12-30 06:51:56 -0500
committerGitHub <noreply@github.com>2024-12-30 06:51:56 -0500
commitdbd87e3ab89b7839e41df76c2fa7712855853fd3 (patch)
tree4e4f6d04277efcfcb1b747e72bf53cdb2ac0dec6 /plugins/module_utils
parentcae1c6cc42fa786095433692a6d685f029bbde2e (diff)
downloadvyos.vyos-dbd87e3ab89b7839e41df76c2fa7712855853fd3.tar.gz
vyos.vyos-dbd87e3ab89b7839e41df76c2fa7712855853fd3.zip
T6982: update SNMP module for 1.3+ (#369)
* fix: get SNMP integration tests running * fix: remove no_log from docs because it fails sanity * tests: fix unit tests and no_log args * tests: fix error in hostname integration test
Diffstat (limited to 'plugins/module_utils')
-rw-r--r--plugins/module_utils/network/vyos/argspec/snmp_server/snmp_server.py9
-rw-r--r--plugins/module_utils/network/vyos/rm_templates/snmp_server.py24
2 files changed, 12 insertions, 21 deletions
diff --git a/plugins/module_utils/network/vyos/argspec/snmp_server/snmp_server.py b/plugins/module_utils/network/vyos/argspec/snmp_server/snmp_server.py
index 7d0fefec..b94c2639 100644
--- a/plugins/module_utils/network/vyos/argspec/snmp_server/snmp_server.py
+++ b/plugins/module_utils/network/vyos/argspec/snmp_server/snmp_server.py
@@ -108,7 +108,6 @@ class Snmp_serverArgs(object): # pylint: disable=R0903
},
},
},
- "engine_id": {"type": "str"},
"port": {"type": "int"},
"privacy": {
"type": "dict",
@@ -137,13 +136,6 @@ class Snmp_serverArgs(object): # pylint: disable=R0903
},
},
},
- "tsm": {
- "type": "dict",
- "options": {
- "local_key": {"type": "str", "no_log": True},
- "port": {"type": "int"},
- },
- },
"users": {
"type": "list",
"elements": "dict",
@@ -166,7 +158,6 @@ class Snmp_serverArgs(object): # pylint: disable=R0903
},
},
},
- "engine_id": {"type": "str"},
"group": {"type": "str"},
"mode": {"type": "str", "choices": ["ro", "rw"]},
"privacy": {
diff --git a/plugins/module_utils/network/vyos/rm_templates/snmp_server.py b/plugins/module_utils/network/vyos/rm_templates/snmp_server.py
index 724be228..71753083 100644
--- a/plugins/module_utils/network/vyos/rm_templates/snmp_server.py
+++ b/plugins/module_utils/network/vyos/rm_templates/snmp_server.py
@@ -82,9 +82,9 @@ def _tmplt_snmp_server_v3_trap_target(config_data):
if "type" in config_data:
command += " type {mode}".format(**config_data)
if "encrypted_key" in config_data:
- command += " encrypted-key {encrypted_key}".format(**config_data)
+ command += " encrypted-password {encrypted_key}".format(**config_data)
if "plaintext_key" in config_data:
- command += " plaintext-key {plaintext_key}".format(**config_data)
+ command += " plaintext-password {plaintext_key}".format(**config_data)
return command
@@ -103,10 +103,10 @@ def _tmplt_snmp_server_v3_user(config_data):
type_cmd = cmd + val + " type {type}".format(**config)
command.append(type_cmd)
if "encrypted_key" in config:
- enc_cmd = cmd + val + " encrypted-key {encrypted_key}".format(**config)
+ enc_cmd = cmd + val + " encrypted-password {encrypted_key}".format(**config)
command.append(enc_cmd)
if "plaintext_key" in config:
- plain_cmd = cmd + val + " plaintext-key {plaintext_key}".format(**config)
+ plain_cmd = cmd + val + " plaintext-password {plaintext_key}".format(**config)
command.append(plain_cmd)
return command
@@ -329,8 +329,8 @@ class Snmp_serverTemplate(NetworkTemplate):
^set\sservice\ssnmp\sv3\strap-target
\s+(?P<name>\S+)
\s+auth
- \s*(?P<enc>encrypted-key\s\S+)*
- \s*(?P<plain>plaintext-key\s\S+)*
+ \s*(?P<enc>encrypted-password\s\S+)*
+ \s*(?P<plain>plaintext-password\s\S+)*
\s*(?P<type>type\s\S+)*
$""",
re.VERBOSE,
@@ -451,8 +451,8 @@ class Snmp_serverTemplate(NetworkTemplate):
^set\sservice\ssnmp\sv3\strap-target
\s+(?P<name>\S+)
\s+privacy
- \s*(?P<enc>encrypted-key\s\S+)*
- \s*(?P<plain>plaintext-key\s\S+)*
+ \s*(?P<enc>encrypted-password\s\S+)*
+ \s*(?P<plain>plaintext-password\s\S+)*
\s*(?P<type>type\s\S+)*
$""",
re.VERBOSE,
@@ -481,8 +481,8 @@ class Snmp_serverTemplate(NetworkTemplate):
^set\sservice\ssnmp\sv3\suser
\s+(?P<name>\S+)
\s+auth
- \s*(?P<enc>encrypted-key\s\S+)*
- \s*(?P<plain>plaintext-key\s\S+)*
+ \s*(?P<enc>encrypted-password\s\S+)*
+ \s*(?P<plain>plaintext-password\s\S+)*
\s*(?P<type>type\s\S+)*
$""",
re.VERBOSE,
@@ -511,8 +511,8 @@ class Snmp_serverTemplate(NetworkTemplate):
^set\sservice\ssnmp\sv3\suser
\s+(?P<name>\S+)
\s+privacy
- \s*(?P<enc>encrypted-key\s\S+)*
- \s*(?P<plain>plaintext-key\s\S+)*
+ \s*(?P<enc>encrypted-password\s\S+)*
+ \s*(?P<plain>plaintext-password\s\S+)*
\s*(?P<type>type\s\S+)*
$""",
re.VERBOSE,