]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
3PAR driver terminate connection host validation
authorKurt Martin <kurt.f.martin@hp.com>
Wed, 21 Aug 2013 16:38:54 +0000 (09:38 -0700)
committerKurt Martin <kurt.f.martin@hp.com>
Wed, 21 Aug 2013 16:38:54 +0000 (09:38 -0700)
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
cinder/volume/drivers/san/hp/hp_3par_iscsi.py

index 300c9668022197af1968e70f5624af2fb7dc57e6..4be85571894663bd74e3be19730aad5eedf3e8a2 100644 (file)
@@ -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()
 
index 94670299e4c72058de0a10f4462120d7fe57ab7b..db3dad6fa2c6a7bb2c3c439c68cef7caa97b088d 100644 (file)
@@ -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()