Merge "NEC driver: Fix exception in terminate_connection with no connector"
This commit is contained in:
commit
274ce06f58
@ -992,6 +992,9 @@ class ExportTest(volume_helper.MStorageDSVDriver, unittest.TestCase):
|
|||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
'2A00000991020012',
|
'2A00000991020012',
|
||||||
info['data']['initiator_target_map']['10000090FAA0786B'][3])
|
info['data']['initiator_target_map']['10000090FAA0786B'][3])
|
||||||
|
info = self._fc_terminate_connection(self.vol, None)
|
||||||
|
self.assertEqual('fibre_channel', info['driver_volume_type'])
|
||||||
|
self.assertEqual({}, info['data'])
|
||||||
|
|
||||||
|
|
||||||
class DeleteDSVVolume_test(volume_helper.MStorageDSVDriver,
|
class DeleteDSVVolume_test(volume_helper.MStorageDSVDriver,
|
||||||
|
@ -1396,12 +1396,15 @@ class MStorageDriver(volume_common.MStorageVolumeCommon):
|
|||||||
for port in hostport:
|
for port in hostport:
|
||||||
if port['protocol'].lower() == 'fc':
|
if port['protocol'].lower() == 'fc':
|
||||||
fc_ports.append(port)
|
fc_ports.append(port)
|
||||||
target_wwns, init_targ_map = (
|
|
||||||
self._build_initiator_target_map(connector, fc_ports))
|
|
||||||
|
|
||||||
info = {'driver_volume_type': 'fibre_channel',
|
info = {'driver_volume_type': 'fibre_channel',
|
||||||
'data': {'target_wwn': target_wwns,
|
'data': {}}
|
||||||
'initiator_target_map': init_targ_map}}
|
if connector is not None:
|
||||||
|
target_wwns, init_targ_map = (
|
||||||
|
self._build_initiator_target_map(connector, fc_ports))
|
||||||
|
info['data'] = {'target_wwn': target_wwns,
|
||||||
|
'initiator_target_map': init_targ_map}
|
||||||
|
|
||||||
LOG.debug('_fc_terminate_connection'
|
LOG.debug('_fc_terminate_connection'
|
||||||
'(Volume ID = %(id)s, connector = %(connector)s, '
|
'(Volume ID = %(id)s, connector = %(connector)s, '
|
||||||
'info = %(info)s) End.',
|
'info = %(info)s) End.',
|
||||||
@ -1429,6 +1432,8 @@ class MStorageDriver(volume_common.MStorageVolumeCommon):
|
|||||||
for port in fc_ports:
|
for port in fc_ports:
|
||||||
target_wwns.append(port['wwpn'])
|
target_wwns.append(port['wwpn'])
|
||||||
|
|
||||||
|
initiator_wwns = []
|
||||||
|
if connector is not None:
|
||||||
initiator_wwns = connector['wwpns']
|
initiator_wwns = connector['wwpns']
|
||||||
|
|
||||||
init_targ_map = {}
|
init_targ_map = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user