From f1e67f5140ef35bfa8bef53adbc17d0ef9ddba33 Mon Sep 17 00:00:00 2001 From: Jim Branen Date: Fri, 20 Sep 2013 08:41:44 -0700 Subject: [PATCH] Fix HP3PAR iSCSI path connection MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The iSCSI paths are not correctly identified as ‘active’ when port information is requested from the hp3parclient because the ‘active’ value is a Boolean not the string ‘true’. Fixes Bug #1224594 Change-Id: Ib10563cfc31c0628dc8b1edbba246398a3a11f34 --- cinder/tests/test_hp3par.py | 6 +++--- cinder/volume/drivers/san/hp/hp_3par_iscsi.py | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cinder/tests/test_hp3par.py b/cinder/tests/test_hp3par.py index c418f9cc8..f6adbb676 100644 --- a/cinder/tests/test_hp3par.py +++ b/cinder/tests/test_hp3par.py @@ -1103,7 +1103,7 @@ class TestHP3PARISCSIDriver(HP3PARBaseDriver, test.TestCase): self.mox.ReplayAll() ip = self.driver._get_iscsi_ip('fakehost') - self.assertEqual(ip, '10.10.220.253') + self.assertEqual(ip, '10.10.220.252') def test_get_iscsi_ip(self): self.flags(lock_path=self.tempdir) @@ -1248,11 +1248,11 @@ VLUNS2_RET = ({'members': [{'portPos': {'node': 1, 'slot': 8, 'cardPort': 2}, 'hostname': 'bar', 'active': True}, {'portPos': {'node': 1, 'slot': 8, 'cardPort': 1}, - 'hostname': 'fakehost', 'active': True}, + 'hostname': 'bar', 'active': True}, {'portPos': {'node': 1, 'slot': 8, 'cardPort': 2}, 'hostname': 'bar', 'active': True}, {'portPos': {'node': 1, 'slot': 8, 'cardPort': 2}, - 'hostname': 'bar', 'active': True}]}) + 'hostname': 'fakehost', 'active': True}]}) VLUNS3_RET = ({'members': [{'portPos': {'node': 1, 'slot': 8, 'cardPort': 2}, diff --git a/cinder/volume/drivers/san/hp/hp_3par_iscsi.py b/cinder/volume/drivers/san/hp/hp_3par_iscsi.py index c81ccd188..d615048eb 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_iscsi.py +++ b/cinder/volume/drivers/san/hp/hp_3par_iscsi.py @@ -58,9 +58,10 @@ class HP3PARISCSIDriver(cinder.volume.driver.ISCSIDriver): 1.2.1 - Synchronized extend_volume method. 1.2.2 - Added try/finally around client login/logout. 1.2.3 - log exceptions before raising + 1.2.4 - Fixed iSCSI active path bug #1224594 """ - VERSION = "1.2.3" + VERSION = "1.2.4" def __init__(self, *args, **kwargs): super(HP3PARISCSIDriver, self).__init__(*args, **kwargs) @@ -363,7 +364,7 @@ class HP3PARISCSIDriver(cinder.volume.driver.ISCSIDriver): # see if there is already a path to the # host, if so use it for vlun in vluns['members']: - if vlun['active'] == 'true': + if vlun['active']: if vlun['hostname'] == hostname: # this host already has a path, so use it nsp = self.common.build_nsp(vlun['portPos']) -- 2.45.2