From 68a18f49472ac7686ceab15e9788dcef05764822 Mon Sep 17 00:00:00 2001 From: Goutham Pacha Ravi Date: Thu, 21 Mar 2019 07:13:06 -0700 Subject: [PATCH] Dummy driver: Don't fail unmanage on malformed share servers When a share server is managed with invalid details, since we cannot find backend network allocations in the dummy driver, we raise an error on manage, setting the status to "manage_error". Such a share server can be "unmanaged" or deleted, and we shouldn't fail this request, either case. Change-Id: I4144a532d5827b929a1dce0d4d642e6d1cee47b1 Related-Bug: #1820118 --- manila/tests/share/drivers/dummy.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/manila/tests/share/drivers/dummy.py b/manila/tests/share/drivers/dummy.py index f22f54b106..28458f5b5f 100644 --- a/manila/tests/share/drivers/dummy.py +++ b/manila/tests/share/drivers/dummy.py @@ -721,5 +721,15 @@ class DummyDriver(driver.ShareDriver): return identifier, server_details def unmanage_server(self, server_details, security_services=None): + server_details = server_details or {} + if not server_details or 'server_id' not in server_details: + # This share server doesn't have any network details. Since it's + # just being cleaned up, we'll log a warning and return without + # errors. + LOG.warning("Share server does not have network information. " + "It is being unmanaged, but cannot be re-managed " + "without first creating network allocations in this " + "driver's private storage.") + return self.private_storage.update(server_details['server_id'], server_details)