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
This commit is contained in:
Goutham Pacha Ravi 2019-03-21 07:13:06 -07:00
parent beffa2595a
commit 68a18f4947
1 changed files with 10 additions and 0 deletions

View File

@ -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)