self.driver.initialize_connection,
vol1, self.connector)
+ # case 4: terminate_connection with no host
+ with mock.patch.object(flashsystem_fc.FlashSystemFCDriver,
+ '_get_hostvdisk_mappings') as mock_host:
+ mock_host.return_value = {}
+ vol3 = self._generate_vol_info(None)
+ self.driver.create_volume(vol3)
+ self.driver.initialize_connection(vol3, self.connector)
+ return_value = self.driver.terminate_connection(vol3,
+ self.connector)
+ self.assertNotEqual({}, return_value['data'])
+
+ # case 5: terminate_connection with host
+ vol4 = self._generate_vol_info(None)
+ self.driver.create_volume(vol4)
+ self.driver.initialize_connection(vol4, self.connector)
+ vol5 = self._generate_vol_info(None)
+ self.driver.create_volume(vol5)
+ self.driver.initialize_connection(vol5, self.connector)
+ return_value = self.driver.terminate_connection(vol4,
+ self.connector)
+ self.assertEqual({}, return_value['data'])
+
# clear environment
self.driver.delete_volume(vol1)
+ self.driver.delete_volume(vol2)
+ self.driver.delete_volume(vol3)
+ self.driver.delete_volume(vol4)
+ self.driver.delete_volume(vol5)
@mock.patch.object(flashsystem_fc.FlashSystemFCDriver,
'_create_and_copy_vdisk_data')
1.0.3 - Initial driver for iSCSI
1.0.4 - Split Flashsystem driver into common and FC
1.0.5 - Report capability of volume multiattach
+ 1.0.6 - Fix bug #1469581, add I/T mapping check in
+ terminate_connection
"""
- VERSION = "1.0.5"
+ VERSION = "1.0.6"
def __init__(self, *args, **kwargs):
super(FlashSystemDriver, self).__init__(*args, **kwargs)
1.0.3 - Initial driver for iSCSI
1.0.4 - Split Flashsystem driver into common and FC
1.0.5 - Report capability of volume multiattach
+ 1.0.6 - Fix bug #1469581, add I/T mapping check in
+ terminate_connection
"""
- VERSION = "1.0.5"
+ VERSION = "1.0.6"
def __init__(self, *args, **kwargs):
super(FlashSystemFCDriver, self).__init__(*args, **kwargs)
'connector %(conn)s.',
{'vol': volume, 'conn': connector})
+ return_data = {
+ 'driver_volume_type': 'fibre_channel',
+ 'data': {},
+ }
+
vdisk_name = volume['name']
self._wait_vdisk_copy_completed(vdisk_name)
self._unmap_vdisk_from_host(vdisk_name, connector)
- properties = {}
- conn_wwpns = self._get_conn_fc_wwpns()
- properties['target_wwn'] = conn_wwpns
- # TODO(edwin): add judgement here. No initiator_target_map within
- # properties need if no more I/T connection. Otherwise the FCZone
- # manager will remove the zoning between I/T.
- properties['initiator_target_map'] = self._build_initiator_target_map(
- connector['wwpns'], conn_wwpns)
+ host_name = self._get_host_from_connector(connector)
+ if not host_name:
+ properties = {}
+ conn_wwpns = self._get_conn_fc_wwpns()
+ properties['target_wwn'] = conn_wwpns
+ properties['initiator_target_map'] = (
+ self._build_initiator_target_map(
+ connector['wwpns'], conn_wwpns))
+ return_data['data'] = properties
LOG.debug(
'leave: terminate_connection: volume %(vol)s with '
'connector %(conn)s.', {'vol': volume, 'conn': connector})
- return {
- 'driver_volume_type': 'fibre_channel',
- 'data': properties
- }
+ return return_data
def do_setup(self, ctxt):
"""Check that we have all configuration details from the storage."""
1.0.3 - Initial driver for iSCSI
1.0.4 - Split Flashsystem driver into common and FC
1.0.5 - Report capability of volume multiattach
+ 1.0.6 - Fix bug #1469581, add I/T mapping check in
+ terminate_connection
"""
- VERSION = "1.0.5"
+ VERSION = "1.0.6"
def __init__(self, *args, **kwargs):
super(FlashSystemISCSIDriver, self).__init__(*args, **kwargs)