]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Storwize driver should only report active wwpn port
authorTaoBai <baitaosh@cn.ibm.com>
Fri, 17 Apr 2015 09:29:53 +0000 (02:29 -0700)
committerTaoBai <baitaosh@cn.ibm.com>
Fri, 17 Apr 2015 09:30:01 +0000 (02:30 -0700)
Current code will report both active and inactive wwpn port which
will cause connection failure.We should only report active port.

Closes-bug: #1445409

Change-Id: Ide74df778294bfec50fbedd2ac3cd9207201b187

cinder/tests/test_storwize_svc.py
cinder/volume/drivers/ibm/storwize_svc/helpers.py

index 11bfaa5956d6b1e3aaf38d9c53949ad8e3701746..9392d65891a2d3448db3173c4f71cd106ddb378d 100644 (file)
@@ -3458,12 +3458,10 @@ class StorwizeSVCDriverTestCase(test.TestCase):
                      'data': {'initiator_target_map':
                               {'ff00000000000000': ['500507680220C744',
                                                     '500507680210C744',
-                                                    '500507680220C745',
-                                                    '500507680230C745'],
+                                                    '500507680220C745'],
                                'ff00000000000001': ['500507680220C744',
                                                     '500507680210C744',
-                                                    '500507680220C745',
-                                                    '500507680230C745']},
+                                                    '500507680220C745']},
                               'target_discovered': False,
                               'target_lun': 0,
                               'target_wwn': '500507680220C744',
index 9f451f8c156f492fa8fced1e752fe1c356bd3bad..4d65376abb475a2fd8a0d62127a90ed330db8f4c 100644 (file)
@@ -153,7 +153,7 @@ class StorwizeHelpers(object):
             resp = self.ssh.lsnode(node_id=node['id'])
             wwpns = set(node['WWPN'])
             for i, s in resp.select('port_id', 'port_status'):
-                if 'unconfigured' != s:
+                if 'active' == s:
                     wwpns.add(i)
             node['WWPN'] = list(wwpns)
             LOG.info(_LI('WWPN on node %(node)s: %(wwpn)s')