From b8d3e96fd8e8334a8f73c807bb256c7f714c37f5 Mon Sep 17 00:00:00 2001 From: Chris M Date: Wed, 28 Jun 2017 12:53:15 -0400 Subject: [PATCH] Fix exception in dothill iSCSI driver's terminate_connection The test_force_detach_volume test was causing terminate_connection to be called with no connector, and the iSCSI driver didn't have an appropriate check for this condition, causing the CI to fail. Change-Id: I87e720e445243e3ea8ba2d359ceb6233088f3b2a --- cinder/volume/drivers/dothill/dothill_client.py | 2 +- cinder/volume/drivers/dothill/dothill_iscsi.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cinder/volume/drivers/dothill/dothill_client.py b/cinder/volume/drivers/dothill/dothill_client.py index 340c865b00a..c9ba1b97d69 100644 --- a/cinder/volume/drivers/dothill/dothill_client.py +++ b/cinder/volume/drivers/dothill/dothill_client.py @@ -98,7 +98,7 @@ class DotHillClient(object): raise exception.DotHillConnectionError( message=_("Failed to log in to management controller")) - @utils.synchronized(__name__, external = True) + @utils.synchronized(__name__, external=True) def _get_session_key(self): """Retrieve a session key from the array.""" diff --git a/cinder/volume/drivers/dothill/dothill_iscsi.py b/cinder/volume/drivers/dothill/dothill_iscsi.py index 0e07cdb96de..0a171504209 100644 --- a/cinder/volume/drivers/dothill/dothill_iscsi.py +++ b/cinder/volume/drivers/dothill/dothill_iscsi.py @@ -153,7 +153,8 @@ class DotHillISCSIDriver(cinder.volume.driver.ISCSIDriver): self.common.client_logout() def terminate_connection(self, volume, connector, **kwargs): - self.common.unmap_volume(volume, connector, 'initiator') + if type(connector) == dict and 'initiator' in connector: + self.common.unmap_volume(volume, connector, 'initiator') def get_volume_stats(self, refresh=False): stats = self.common.get_volume_stats(refresh)