diff --git a/nova/tests/unit/virt/libvirt/test_driver.py b/nova/tests/unit/virt/libvirt/test_driver.py index 31aef2ebd380..f3f76095d275 100644 --- a/nova/tests/unit/virt/libvirt/test_driver.py +++ b/nova/tests/unit/virt/libvirt/test_driver.py @@ -4932,8 +4932,7 @@ class LibvirtConnTestCase(test.NoDBTestCase, @mock.patch.object(dmcrypt, 'delete_volume') @mock.patch.object(conn._host, '_get_domain', return_value=dom) - @mock.patch.object(libvirt_driver.disk_api, 'get_allocated_disk_size') - def detach_encrypted_volumes(block_device_info, mock_get_alloc_size, + def detach_encrypted_volumes(block_device_info, mock_get_domain, mock_delete_volume): conn._detach_encrypted_volumes(instance, block_device_info) diff --git a/nova/virt/disk/api.py b/nova/virt/disk/api.py index eed4cdd4d814..c79ae77371a0 100644 --- a/nova/virt/disk/api.py +++ b/nova/virt/disk/api.py @@ -107,16 +107,6 @@ def get_disk_size(path): return images.qemu_img_info(path).virtual_size -def get_allocated_disk_size(path): - """Get the allocated size of a disk image - - :param path: Path to the disk image - :returns: Size (in bytes) of the given disk image as allocated on the - filesystem - """ - return images.qemu_img_info(path).disk_size - - def extend(image, size): """Increase image to size.