From 44df1ec42ddc044592b6bdcbe685311677bbbceb Mon Sep 17 00:00:00 2001 From: agireesh Date: Wed, 26 Jun 2024 17:36:01 +0530 Subject: [PATCH] Fixed bug 2069125: Manila driver error with ONTAP SVM-scoped user Fixed the issue for the NetApp driver in the ZAPI workflow where a Vserver-scoped user failed to add rules for a share when the Vserver LIF was not configured with Kerberos. Closes-Bug: #2069125 Change-Id: I8544efbdac207c54d75c55ee4a039c5324433794 (cherry picked from commit 232627db3b39163cfbef00d1e625fcd9a524253a) --- .../drivers/netapp/dataontap/client/client_cmode.py | 11 ++++++++++- ...vm-scoped-user-when-add-rule-1ae120a96dd8f68a.yaml | 8 ++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/bug-2069125-fix-manila-driver-error-with-ontap-svm-scoped-user-when-add-rule-1ae120a96dd8f68a.yaml diff --git a/manila/share/drivers/netapp/dataontap/client/client_cmode.py b/manila/share/drivers/netapp/dataontap/client/client_cmode.py index 1e1e9a1e7c..067be3ec1e 100644 --- a/manila/share/drivers/netapp/dataontap/client/client_cmode.py +++ b/manila/share/drivers/netapp/dataontap/client/client_cmode.py @@ -22,6 +22,7 @@ import re import time from oslo_log import log +from oslo_utils import excutils from oslo_utils import strutils from oslo_utils import units from oslo_utils import uuidutils @@ -2048,7 +2049,15 @@ class NetAppCmodeClient(client_base.NetAppBaseClient): } } } - result = self.send_request('kerberos-config-get', api_args) + result = None + # Catch the exception in case kerberos is not configured with LIF. + try: + result = self.send_request('kerberos-config-get', api_args) + except netapp_api.NaApiError as e: + with excutils.save_and_reraise_exception() as exc_context: + if "entry doesn't exist" in e.message: + exc_context.reraise = False + return False attributes = result.get_child_by_name('attributes') kerberos_info = attributes.get_child_by_name( diff --git a/releasenotes/notes/bug-2069125-fix-manila-driver-error-with-ontap-svm-scoped-user-when-add-rule-1ae120a96dd8f68a.yaml b/releasenotes/notes/bug-2069125-fix-manila-driver-error-with-ontap-svm-scoped-user-when-add-rule-1ae120a96dd8f68a.yaml new file mode 100644 index 0000000000..5b58dbdb3a --- /dev/null +++ b/releasenotes/notes/bug-2069125-fix-manila-driver-error-with-ontap-svm-scoped-user-when-add-rule-1ae120a96dd8f68a.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + NetApp driver `bug #2069125 + `_: + Fixed the issue for the NetApp ONTAP driver in the ZAPI workflow, + where certain vserver accounts failed to add access rules for a share + when the vserver network interface was not configured with kerberos.