From da189e8de056894a1293253d030a6d21b1191032 Mon Sep 17 00:00:00 2001 From: Chris Archibald Date: Thu, 16 Nov 2023 17:14:27 +0000 Subject: [PATCH] Sync bitbucket and GitHub --- README.md | 1 + changelogs/fragments/DEVOPS-6413.yaml | 5 ++++- plugins/modules/na_ontap_snmp.py | 9 ++++----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 06c6c20f..82b06a4a 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ The following modules do not have REST equivalent APIs. They will stop working o ### Bug Fixes - na_ontap_vserver_peer - fix issue with peering multiple clusters with same vserver name in REST. - na_ontap_ems_destination - fix field error with `certificate.name` for ONTAP 9.11.1 or later in REST. + - na_ontap_snmp - fix for getting error when `authentication_method` set to default with ZAPI. ## 22.8.1 diff --git a/changelogs/fragments/DEVOPS-6413.yaml b/changelogs/fragments/DEVOPS-6413.yaml index eb2cc946..2a7e8b16 100644 --- a/changelogs/fragments/DEVOPS-6413.yaml +++ b/changelogs/fragments/DEVOPS-6413.yaml @@ -1,2 +1,5 @@ minor_changes: - - na_ontap_snmp - added REST support for snmpv3 user. \ No newline at end of file + - na_ontap_snmp - added REST support for snmpv3 user. + +bugfixes: + - na_ontap_snmp - fix for getting error when `authentication_method` set to default with ZAPI. \ No newline at end of file diff --git a/plugins/modules/na_ontap_snmp.py b/plugins/modules/na_ontap_snmp.py index f5780d96..acde02da 100644 --- a/plugins/modules/na_ontap_snmp.py +++ b/plugins/modules/na_ontap_snmp.py @@ -40,8 +40,7 @@ choices: ['community', 'usm', 'both'] description: - Authentication method for SNMP user. - - Only supported with REST. - default: 'community' + - Only supported with REST. The default value is community. type: str version_added: 22.8.0 snmpv3: @@ -164,8 +163,7 @@ def __init__(self): state=dict(required=False, type='str', choices=['present', 'absent'], default='present'), snmp_username=dict(required=True, type='str'), access_control=dict(required=False, type='str', choices=['ro'], default='ro'), - authentication_method=dict(required=False, type='str', - choices=['community', 'usm', 'both'], default='community'), + authentication_method=dict(required=False, type='str', choices=['community', 'usm', 'both']), snmpv3=dict(required=False, type='dict', options=dict( authentication_password=dict(required=True, type='str', no_log=True), @@ -203,7 +201,7 @@ def __init__(self): for unsupported_zapi_property in self.unsupported_zapi_properties: if self.parameters.get(unsupported_zapi_property) is not None: msg = "Error: %s option is not supported with ZAPI. It can only be used with REST." % unsupported_zapi_property - self.module.fail_json(msg=msg) + self.module.fail_json(msg=msg) self.server = netapp_utils.setup_na_ontap_zapi(module=self.module) def invoke_snmp_community(self, zapi): @@ -272,6 +270,7 @@ def add_snmp_user(self): def add_snmp_rest(self): api = 'support/snmp/users' + self.parameters['authentication_method'] = self.parameters.get('authentication_method', 'community') body = { 'name': self.parameters['snmp_username'], 'authentication_method': self.parameters['authentication_method']