diff --git a/nova/tests/unit/virt/libvirt/test_driver.py b/nova/tests/unit/virt/libvirt/test_driver.py index 417d919c0a..2cc841acda 100644 --- a/nova/tests/unit/virt/libvirt/test_driver.py +++ b/nova/tests/unit/virt/libvirt/test_driver.py @@ -17982,19 +17982,6 @@ class LibvirtDriverTestCase(test.NoDBTestCase): mock_rename.assert_has_calls([ mock.call(_path_qcow, path)]) - @mock.patch('nova.utils.execute') - @mock.patch('os.rename') - def test_disk_qcow2_to_raw(self, mock_rename, mock_execute): - path = '/test/disk' - _path_raw = path + '_raw' - - self.drvr._disk_qcow2_to_raw(path) - mock_execute.assert_has_calls([ - mock.call('qemu-img', 'convert', '-f', 'qcow2', - '-O', 'raw', path, _path_raw)]) - mock_rename.assert_has_calls([ - mock.call(_path_raw, path)]) - @mock.patch.object(libvirt_driver.LibvirtDriver, '_inject_data') @mock.patch.object(libvirt_driver.LibvirtDriver, 'get_info') @mock.patch.object(libvirt_driver.LibvirtDriver, diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 9d69503c0f..ff42a64cbc 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -8223,14 +8223,6 @@ class LibvirtDriver(driver.ComputeDriver): '-O', 'qcow2', path, path_qcow) os.rename(path_qcow, path) - @staticmethod - def _disk_qcow2_to_raw(path): - """Converts a qcow2 disk to raw.""" - path_raw = path + '_raw' - utils.execute('qemu-img', 'convert', '-f', 'qcow2', - '-O', 'raw', path, path_raw) - os.rename(path_raw, path) - def finish_migration(self, context, migration, instance, disk_info, network_info, image_meta, resize_instance, block_device_info=None, power_on=True):