From 48924054f8ac4f591b6eee0d32366b5f4cbc445b Mon Sep 17 00:00:00 2001 From: Yong Huang Date: Thu, 5 Aug 2021 16:58:52 +0800 Subject: [PATCH] [Unity]: Delete fs with retry when deleting share --- .../drivers/dell_emc/plugins/unity/connection.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/manila/share/drivers/dell_emc/plugins/unity/connection.py b/manila/share/drivers/dell_emc/plugins/unity/connection.py index a5f8094..f5dd74d 100644 --- a/manila/share/drivers/dell_emc/plugins/unity/connection.py +++ b/manila/share/drivers/dell_emc/plugins/unity/connection.py @@ -44,9 +44,10 @@ 7.0.3 - Bugfix: remove enable ace process when creating cifs share 7.0.4 - Bugfix: ignore the has snaps error when deleting filesystem 7.0.5 - Bugfix: fix the driver startup issue with LACP ports configured + 7.0.6 - Bugfix: delete filesystem with retry when deleting share """ -VERSION = "7.0.5" +VERSION = "7.0.6" LOG = log.getLogger(__name__) SUPPORTED_NETWORK_TYPES = (None, 'flat', 'vlan') @@ -264,6 +265,12 @@ def create_share_from_snapshot(self, context, share, snapshot, return locations + @utils.retry(storops_ex.UnityDeleteStorageResourceHasSnapError, + interval=5, + retries=6) + def _delete_fs_with_retry(self, filesystem): + self.client.delete_filesystem(filesystem) + def delete_share(self, context, share, share_server=None): """Delete a share.""" share_name = share['id'] @@ -284,11 +291,7 @@ def delete_share(self, context, share, share_server=None): self.client.delete_share(backend_share) if self._is_isolated_filesystem(filesystem): - try: - self.client.delete_filesystem(filesystem) - except storops_ex.UnityDeleteStorageResourceHasSnapError: - LOG.info("Filesystem %s has one or more snapshots, " - "ignore it.", filesystem.name) + self._delete_fs_with_retry(filesystem) def extend_share(self, share, new_size, share_server=None): backend_share = self.client.get_share(share['id'],