Fix wrong command for _rescan_multipath
The _run_multipath command is wrong in [1], it should be 'multipath -r' not 'multipath - r'. And adds test for this. [1]: https://github.com/openstack/nova/blob/master/nova/virt/libvirt/volume.py#L590 Change-Id: I3c5d12cc11988d65a8fc9e6143d26c2d1220d253 Closes-bug: 1362916
This commit is contained in:
parent
eccc42d496
commit
51f3eb66ef
|
@ -241,6 +241,12 @@ class LibvirtVolumeTestCase(test.NoDBTestCase):
|
|||
}
|
||||
}
|
||||
|
||||
def test_rescan_multipath(self):
|
||||
libvirt_driver = volume.LibvirtISCSIVolumeDriver(self.fake_conn)
|
||||
libvirt_driver._rescan_multipath()
|
||||
expected_multipath_cmd = ('multipath', '-r')
|
||||
self.assertIn(expected_multipath_cmd, self.executes)
|
||||
|
||||
def test_libvirt_iscsi_driver(self):
|
||||
# NOTE(vish) exists is to make driver assume connecting worked
|
||||
self.stubs.Set(os.path, 'exists', lambda x: True)
|
||||
|
|
|
@ -587,7 +587,7 @@ class LibvirtISCSIVolumeDriver(LibvirtBaseVolumeDriver):
|
|||
check_exit_code=[0, 1, 21, 255])
|
||||
|
||||
def _rescan_multipath(self):
|
||||
self._run_multipath('-r', check_exit_code=[0, 1, 21])
|
||||
self._run_multipath(['-r'], check_exit_code=[0, 1, 21])
|
||||
|
||||
def _get_host_device(self, iscsi_properties):
|
||||
return ("/dev/disk/by-path/ip-%s-iscsi-%s-lun-%s" %
|
||||
|
|
Loading…
Reference in New Issue