diff --git a/manila/share/drivers/ganesha/manager.py b/manila/share/drivers/ganesha/manager.py index 17ef1fe0dd..48b4917c3c 100644 --- a/manila/share/drivers/ganesha/manager.py +++ b/manila/share/drivers/ganesha/manager.py @@ -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( diff --git a/manila/tests/share/drivers/ganesha/test_manager.py b/manila/tests/share/drivers/ganesha/test_manager.py index 57753a0309..2c98fdfc01 100644 --- a/manila/tests/share/drivers/ganesha/test_manager.py +++ b/manila/tests/share/drivers/ganesha/test_manager.py @@ -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') diff --git a/releasenotes/notes/bug-2035572-ignore-errors-remove-export-nfs-ganesha-fd0f8eb1db800d31.yaml b/releasenotes/notes/bug-2035572-ignore-errors-remove-export-nfs-ganesha-fd0f8eb1db800d31.yaml new file mode 100644 index 0000000000..64d126c0b2 --- /dev/null +++ b/releasenotes/notes/bug-2035572-ignore-errors-remove-export-nfs-ganesha-fd0f8eb1db800d31.yaml @@ -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 `_ + for more information.