From: Anthony Lee Date: Tue, 9 Sep 2014 13:53:25 +0000 (-0700) Subject: Fixing leaking sessions in 3PAR on attach/detach X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=519aa064f56447b4a0b1bdbde06f26afe139223d;p=openstack-build%2Fcinder-build.git Fixing leaking sessions in 3PAR on attach/detach Fixed an issue where sessions were not being closed properly during an attach or detach of a volume. Closes-Bug: 1367429 Change-Id: Ic7a4ceca855111a8c8a9512fc2d99fcf6df6d79e --- diff --git a/cinder/volume/drivers/san/hp/hp_3par_fc.py b/cinder/volume/drivers/san/hp/hp_3par_fc.py index 936722a17..abfa77675 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_fc.py +++ b/cinder/volume/drivers/san/hp/hp_3par_fc.py @@ -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): diff --git a/cinder/volume/drivers/san/hp/hp_3par_iscsi.py b/cinder/volume/drivers/san/hp/hp_3par_iscsi.py index b0803f4a1..3027df043 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_iscsi.py +++ b/cinder/volume/drivers/san/hp/hp_3par_iscsi.py @@ -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):