]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fixing leaking sessions in 3PAR on attach/detach
authorAnthony Lee <anthony.mic.lee@hp.com>
Tue, 9 Sep 2014 13:53:25 +0000 (06:53 -0700)
committerAnthony Lee <anthony.mic.lee@hp.com>
Tue, 9 Sep 2014 13:53:55 +0000 (06:53 -0700)
Fixed an issue where sessions were not being closed properly
during an attach or detach of a volume.

Closes-Bug: 1367429
Change-Id: Ic7a4ceca855111a8c8a9512fc2d99fcf6df6d79e

cinder/volume/drivers/san/hp/hp_3par_fc.py
cinder/volume/drivers/san/hp/hp_3par_iscsi.py

index 936722a172bda874138412975f4d81fd66a02fd1..abfa7767522022a9d6a0def64630334713496a63 100644 (file)
@@ -68,10 +68,11 @@ class HP3PARFCDriver(cinder.volume.driver.FibreChannelDriver):
         2.0.6 - Added support for volume retype
         2.0.7 - Only one FC port is used when a single FC path
                 is present.  bug #1360001
+        2.0.8 - Fixing missing login/logout around attach/detach bug #1367429
 
     """
 
-    VERSION = "2.0.7"
+    VERSION = "2.0.8"
 
     def __init__(self, *args, **kwargs):
         super(HP3PARFCDriver, self).__init__(*args, **kwargs)
@@ -435,11 +436,19 @@ class HP3PARFCDriver(cinder.volume.driver.FibreChannelDriver):
     @utils.synchronized('3par', external=True)
     def attach_volume(self, context, volume, instance_uuid, host_name,
                       mountpoint):
-        self.common.attach_volume(volume, instance_uuid)
+        self.common.client_login()
+        try:
+            self.common.attach_volume(volume, instance_uuid)
+        finally:
+            self.common.client_logout()
 
     @utils.synchronized('3par', external=True)
     def detach_volume(self, context, volume):
-        self.common.detach_volume(volume)
+        self.common.client_login()
+        try:
+            self.common.detach_volume(volume)
+        finally:
+            self.common.client_logout()
 
     @utils.synchronized('3par', external=True)
     def retype(self, context, volume, new_type, diff, host):
index b0803f4a1c858ff251caf1999a7d870bda859c05..3027df043b5e7a9accd09e5f992da61498f2bab6 100644 (file)
@@ -73,10 +73,11 @@ class HP3PARISCSIDriver(cinder.volume.driver.ISCSIDriver):
         2.0.4 - Added support for volume retype
         2.0.5 - Added CHAP support, requires 3.1.3 MU1 firmware
                 and hp3parclient 3.1.0.
+        2.0.6 - Fixing missing login/logout around attach/detach bug #1367429
 
     """
 
-    VERSION = "2.0.5"
+    VERSION = "2.0.6"
 
     def __init__(self, *args, **kwargs):
         super(HP3PARISCSIDriver, self).__init__(*args, **kwargs)
@@ -643,11 +644,19 @@ class HP3PARISCSIDriver(cinder.volume.driver.ISCSIDriver):
     @utils.synchronized('3par', external=True)
     def attach_volume(self, context, volume, instance_uuid, host_name,
                       mountpoint):
-        self.common.attach_volume(volume, instance_uuid)
+        self.common.client_login()
+        try:
+            self.common.attach_volume(volume, instance_uuid)
+        finally:
+            self.common.client_logout()
 
     @utils.synchronized('3par', external=True)
     def detach_volume(self, context, volume):
-        self.common.detach_volume(volume)
+        self.common.client_login()
+        try:
+            self.common.detach_volume(volume)
+        finally:
+            self.common.client_logout()
 
     @utils.synchronized('3par', external=True)
     def retype(self, context, volume, new_type, diff, host):