From 5a49640ba85adceb9fe91f745e5e374c3ee5a112 Mon Sep 17 00:00:00 2001 From: Kurt Martin Date: Wed, 21 Aug 2013 09:38:54 -0700 Subject: [PATCH] 3PAR driver terminate connection host validation The 3PAR backend does not allow FQDN host names (i.e. foo.rose.hp.com), instead it requires just foo without the rose.hp.com. This patch will now validate the host name in terminate connection by calling _safe_host just as it was doing in initialize connection when creating the host on the 3PAR backend. Change-Id: I52e90938c782473edc93f30672a0530ab5934edc Fixes: bug 1214994 --- cinder/volume/drivers/san/hp/hp_3par_fc.py | 4 ++-- cinder/volume/drivers/san/hp/hp_3par_iscsi.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cinder/volume/drivers/san/hp/hp_3par_fc.py b/cinder/volume/drivers/san/hp/hp_3par_fc.py index 300c96680..4be855718 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_fc.py +++ b/cinder/volume/drivers/san/hp/hp_3par_fc.py @@ -193,8 +193,8 @@ class HP3PARFCDriver(cinder.volume.driver.FibreChannelDriver): def terminate_connection(self, volume, connector, **kwargs): """Driver entry point to unattach a volume from an instance.""" self.common.client_login() - self.common.terminate_connection(volume, - connector['host'], + hostname = self.common._safe_hostname(connector['host']) + self.common.terminate_connection(volume, hostname, connector['wwpns']) self.common.client_logout() diff --git a/cinder/volume/drivers/san/hp/hp_3par_iscsi.py b/cinder/volume/drivers/san/hp/hp_3par_iscsi.py index 94670299e..db3dad6fa 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_iscsi.py +++ b/cinder/volume/drivers/san/hp/hp_3par_iscsi.py @@ -252,8 +252,8 @@ class HP3PARISCSIDriver(cinder.volume.driver.ISCSIDriver): def terminate_connection(self, volume, connector, **kwargs): """Driver entry point to unattach a volume from an instance.""" self.common.client_login() - self.common.terminate_connection(volume, - connector['host'], + hostname = self.common._safe_hostname(connector['host']) + self.common.terminate_connection(volume, hostname, connector['initiator']) self.common.client_logout() -- 2.45.2