Merge "Don't fail remove-export in NFS-Ganesha"

This commit is contained in:
Zuul 2023-11-09 17:55:39 +00:00 committed by Gerrit Code Review
commit 72280df44c
3 changed files with 18 additions and 4 deletions

View File

@ -514,6 +514,9 @@ class GaneshaManager(object):
try:
confdict = self._read_export(name)
self._remove_export_dbus(confdict["EXPORT"]["Export_Id"])
except Exception:
LOG.exception("There was a problem removing the export. "
"Ignoring errors and continuing operation.")
finally:
if self.ganesha_rados_store_enable:
self._delete_rados_object(

View File

@ -972,8 +972,7 @@ class GaneshaManagerTestCase(test.TestCase):
for method in methods:
self.mock_object(self._manager, method)
self.assertRaises(exception.GaneshaCommandFailure,
self._manager.remove_export, test_name)
ret = self._manager.remove_export(test_name)
self._manager._read_export.assert_called_once_with(test_name)
self.assertFalse(self._manager._remove_export_dbus.called)
@ -994,6 +993,7 @@ class GaneshaManagerTestCase(test.TestCase):
self.assertFalse(self._manager._delete_rados_object.called)
self.assertFalse(
self._manager._remove_rados_object_url_from_index.called)
self.assertIsNone(ret)
@ddt.data(True, False)
def test_remove_export_error_during_remove_export_dbus_with_rados_store(
@ -1012,8 +1012,7 @@ class GaneshaManagerTestCase(test.TestCase):
for method in methods:
self.mock_object(self._manager, method)
self.assertRaises(exception.GaneshaCommandFailure,
self._manager.remove_export, test_name)
ret = self._manager.remove_export(test_name)
self._manager._read_export.assert_called_once_with(test_name)
self._manager._remove_export_dbus.assert_called_once_with(
@ -1035,6 +1034,7 @@ class GaneshaManagerTestCase(test.TestCase):
self.assertFalse(self._manager._delete_rados_object.called)
self.assertFalse(
self._manager._remove_rados_object_url_from_index.called)
self.assertIsNone(ret)
def test_get_rados_object(self):
fakebin = chr(246).encode('utf-8')

View File

@ -0,0 +1,11 @@
---
fixes:
- |
The CephFS driver uses a `RemoveExport` DBUS API call to the NFS/Ganesha
service when a user deletes an access rule, or when deleting the share.
If this call fails, the driver now provides a log of the failure, and
continues cleaning up. Prior to this change, share deletion could fail if
the service failed the DBUS command to drop the export. This would leave
the share with an "error_deleting" status, needing administrator
intervention. See `bug #2035572 <https://launchpad.net/bugs/2035572>`_
for more information.