terminate_connection should be redirected from LVM driver to targets
object. Especially this is required in LioAdm to remove an initiator
from a target. This also fixes some mismatch of method arguments and
remove unused methods in target objects.
Change-Id: Ic42836e995bbdaad92e355b94cb2d7b45d8fdb60
Partial-Bug: #
1408443
expected = {'driver_volume_type': 'iscsi',
'data': self.expected_iscsi_properties}
self.assertEqual(expected,
- self.target.initialize_connection(self.testvol_1))
+ self.target.initialize_connection(self.testvol_1, {}))
def test_validate_connector(self):
bad_connector = {'no_initiator': 'nada'}
return self.target_driver.validate_connector(connector)
def terminate_connection(self, volume, connector, **kwargs):
- pass
+ return self.target_driver.terminate_connection(volume, connector,
+ **kwargs)
class LVMISCSIDriver(LVMVolumeDriver):
pass
@abc.abstractmethod
- def detach_volume(self, context, volume):
- """Callback for volume detached from instance or host."""
- pass
-
- @abc.abstractmethod
- def initialize_connection(self, volume, **kwargs):
+ def initialize_connection(self, volume, connector):
"""Allow connection to connector and return connection info."""
pass
- def terminate_connection(self, volume, **kwargs):
+ def terminate_connection(self, volume, connector, **kwargs):
"""Disallow connection from connector."""
pass
def remove_export(self, context, volume):
pass
- def attach_volume(self, context,
- volume, instance_uuid,
- host_name, mountpoint):
+ def initialize_connection(self, volume, connector):
pass
- def detach_volume(self, context, volume):
- pass
-
- def initialize_connection(self, volume, **kwargs):
- pass
-
- def terminate_connection(self, volume, **kwargs):
+ def terminate_connection(self, volume, connector, **kwargs):
pass
def remove_export(self, context, volume):
pass
- def attach_volume(self, context, volume,
- instance_uuid, host_name, mountpoint):
- pass
-
- def detach_volume(self, context, volume):
- pass
-
- def initialize_connection(self, volume, **kwargs):
- pass
-
- def terminate_connection(self, volume, **kwargs):
+ def initialize_connection(self, volume, connector):
pass
"""Get the current chap auth username and password."""
return None
- def detach_volume(self, context, volume):
- self._get_iscsi_properties(volume)
-
- def initialize_connection(self, volume, **kwargs):
+ def initialize_connection(self, volume, connector):
"""Initializes the connection and returns connection info.
The iscsi driver returns a driver_volume_type of 'iscsi'.
'data': iscsi_properties
}
- def terminate_connection(self, volume, connector):
+ def terminate_connection(self, volume, connector, **kwargs):
volume_iqn = volume['provider_location'].split(' ')[1]
# Delete initiator iqns from target ACL