Merge "Storwize: filter active wwpns for NPIV"
This commit is contained in:
commit
8acf47d807
|
@ -758,13 +758,13 @@ port_speed!N/A
|
|||
value1 = filter1.split('=')[1]
|
||||
value2 = filter2.split('=')[1]
|
||||
for v in ports:
|
||||
if(six.text_type(v[4]) == value1 and six.text_type(
|
||||
if(six.text_type(v[5]) == value1 and six.text_type(
|
||||
v[7]) == value2):
|
||||
rows.append(v)
|
||||
else:
|
||||
value = kwargs['filtervalue'].split('=')[1]
|
||||
for v in ports:
|
||||
if six.text_type(v[4]) == value:
|
||||
if six.text_type(v[5]) == value:
|
||||
rows.append(v)
|
||||
else:
|
||||
rows = ports
|
||||
|
@ -4294,12 +4294,8 @@ class StorwizeSVCFcDriverTestCase(test.TestCase):
|
|||
'initiator': 'iqn.1993-08.org.debian:01:eac5ccc1aaa'}
|
||||
conn_info = self.fc_driver.initialize_connection(volume_fc, connector)
|
||||
expected_target_wwn = ['5005076801A91806',
|
||||
'5005076801B96CFE',
|
||||
'5005076801A96CFE',
|
||||
'5005076801B91806',
|
||||
'5005076801C96CFE',
|
||||
'5005076801996CFE',
|
||||
'5005076801C91806',
|
||||
'5005076801991806']
|
||||
self.assertItemsEqual(expected_target_wwn, conn_info[
|
||||
'data']['target_wwn'])
|
||||
|
@ -4313,21 +4309,13 @@ class StorwizeSVCFcDriverTestCase(test.TestCase):
|
|||
|
||||
# Check that the initiator_target_map is as expected
|
||||
expected_term_data = ['5005076801A96CFE',
|
||||
'5005076801B96CFE',
|
||||
'5005076801C96CFE',
|
||||
'5005076801406CFE',
|
||||
'5005076801A91806',
|
||||
'5005076801301806',
|
||||
'5005076801C91806',
|
||||
'5005076801B91806',
|
||||
'5005076801201806',
|
||||
'5005076801401806',
|
||||
'5005076801991806',
|
||||
'5005076801101806',
|
||||
'5005076801996CFE',
|
||||
'5005076801206CFE',
|
||||
'5005076801106CFE',
|
||||
'5005076801306CFE']
|
||||
'5005076801106CFE']
|
||||
self.assertItemsEqual(expected_term_data, target_wwn1)
|
||||
self.assertItemsEqual(expected_term_data, target_wwn2)
|
||||
|
||||
|
|
|
@ -703,14 +703,14 @@ class StorwizeSSH(object):
|
|||
'-filtervalue', 'node_id=%s' % node_id]
|
||||
return self.run_ssh_info(ssh_cmd, with_header=True)
|
||||
|
||||
def lstargetportfc(self, own_node_id=None, host_io_permitted=None):
|
||||
def lstargetportfc(self, current_node_id=None, host_io_permitted=None):
|
||||
ssh_cmd = ['svcinfo', 'lstargetportfc', '-delim', '!']
|
||||
if own_node_id and host_io_permitted:
|
||||
if current_node_id and host_io_permitted:
|
||||
ssh_cmd += ['-filtervalue', '%s:%s' % (
|
||||
'owning_node_id=%s' % own_node_id,
|
||||
'current_node_id=%s' % current_node_id,
|
||||
'host_io_permitted=%s' % host_io_permitted)]
|
||||
elif own_node_id:
|
||||
ssh_cmd += ['-filtervalue', 'owning_node_id=%s' % own_node_id]
|
||||
elif current_node_id:
|
||||
ssh_cmd += ['-filtervalue', 'current_node_id=%s' % current_node_id]
|
||||
return self.run_ssh_info(ssh_cmd, with_header=True)
|
||||
|
||||
def migratevdisk(self, vdisk, dest_pool, copy_id='0'):
|
||||
|
@ -968,7 +968,7 @@ class StorwizeHelpers(object):
|
|||
wwpns = set()
|
||||
# In the response of lstargetportfc, the host_io_permitted
|
||||
# indicates whether the port can be used for host I/O
|
||||
resp = self.ssh.lstargetportfc(own_node_id=node_id,
|
||||
resp = self.ssh.lstargetportfc(current_node_id=node_id,
|
||||
host_io_permitted=host_io)
|
||||
for port_info in resp:
|
||||
wwpns.add(port_info['WWPN'])
|
||||
|
|
Loading…
Reference in New Issue