Merge "Fix iSCSI multipath cleanup"

This commit is contained in:
Jenkins 2016-08-25 00:22:34 +00:00 committed by Gerrit Code Review
commit 5dfa56d8f4
2 changed files with 3 additions and 3 deletions

View File

@ -136,11 +136,11 @@ class LinuxSCSI(executor.Executor):
LOG.debug("remove multipath device %s", device)
mpath_dev = self.find_multipath_device(device)
if mpath_dev:
self.flush_multipath_device(mpath_dev['id'])
devices = mpath_dev['devices']
LOG.debug("multipath LUNs to remove %s", devices)
for device in devices:
self.remove_scsi_device(device['device'])
self.flush_multipath_device(mpath_dev['id'])
def flush_device_io(self, device):
"""This is used to flush any remaining IO in the buffers."""

View File

@ -168,11 +168,11 @@ class LinuxSCSITestCase(base.TestCase):
self.linuxscsi.remove_multipath_device('/dev/dm-3')
expected_commands = [
('multipath -f 350002ac20398383d'),
('blockdev --flushbufs /dev/sde'),
('tee -a /sys/block/sde/device/delete'),
('blockdev --flushbufs /dev/sdf'),
('tee -a /sys/block/sdf/device/delete'),
('multipath -f 350002ac20398383d'), ]
('tee -a /sys/block/sdf/device/delete'), ]
self.assertEqual(expected_commands, self.cmds)
def test_find_multipath_device_3par_ufn(self):