Merge "Windows: fix connectors 'disconnect_volume' signature"

This commit is contained in:
Zuul 2018-02-13 10:29:51 +00:00 committed by Gerrit Code Review
commit e3b969dfd1
5 changed files with 7 additions and 5 deletions

View File

@ -126,6 +126,6 @@ class WindowsFCConnector(win_conn_base.BaseWindowsConnector):
return mappings return mappings
@utils.trace @utils.trace
def disconnect_volume(self, connection_properties, def disconnect_volume(self, connection_properties, device_info=None,
force=False, ignore_errors=False): force=False, ignore_errors=False):
pass pass

View File

@ -134,7 +134,7 @@ class WindowsISCSIConnector(win_conn_base.BaseWindowsConnector,
return device_info return device_info
@utils.trace @utils.trace
def disconnect_volume(self, connection_properties, def disconnect_volume(self, connection_properties, device_info=None,
force=False, ignore_errors=False): force=False, ignore_errors=False):
# We want to refresh the cached information first. # We want to refresh the cached information first.
self._diskutils.rescan_disks() self._diskutils.rescan_disks()

View File

@ -49,7 +49,7 @@ class WindowsSMBFSConnector(win_conn_base.BaseWindowsConnector):
return device_info return device_info
@utils.trace @utils.trace
def disconnect_volume(self, connection_properties, def disconnect_volume(self, connection_properties, device_info=None,
force=False, ignore_errors=False): force=False, ignore_errors=False):
export_path = self._get_export_path(connection_properties) export_path = self._get_export_path(connection_properties)
self._remotefsclient.unmount(export_path) self._remotefsclient.unmount(export_path)

View File

@ -168,7 +168,8 @@ class WindowsISCSIConnectorTestCase(test_base.WindowsConnectorTestBase):
mock_get_all_targets.return_value = targets mock_get_all_targets.return_value = targets
self._iscsi_utils.get_target_luns.return_value = [mock.sentinel.lun_0] self._iscsi_utils.get_target_luns.return_value = [mock.sentinel.lun_0]
self._connector.disconnect_volume(mock.sentinel.conn_props) self._connector.disconnect_volume(mock.sentinel.conn_props,
mock.sentinel.dev_info)
self._diskutils.rescan_disks.assert_called_once_with() self._diskutils.rescan_disks.assert_called_once_with()
mock_get_all_targets.assert_called_once_with(mock.sentinel.conn_props) mock_get_all_targets.assert_called_once_with(mock.sentinel.conn_props)

View File

@ -46,7 +46,8 @@ class WindowsSMBFSConnectorTestCase(test_base.WindowsConnectorTestBase):
@mock.patch.object(smbfs.WindowsSMBFSConnector, '_get_export_path') @mock.patch.object(smbfs.WindowsSMBFSConnector, '_get_export_path')
def test_disconnect_volume(self, mock_get_export_path): def test_disconnect_volume(self, mock_get_export_path):
self._connector.disconnect_volume(mock.sentinel.conn_props) self._connector.disconnect_volume(mock.sentinel.conn_props,
mock.sentinel.dev_info)
self._remotefs.unmount.assert_called_once_with( self._remotefs.unmount.assert_called_once_with(
mock_get_export_path.return_value) mock_get_export_path.return_value)