From 53bcf60b93ecab601f1df2f1d03fe911f2f818ce Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Fri, 4 Jan 2013 08:48:03 -0800 Subject: [PATCH] Use full instance in virt driver volume usage Right now, the virt driver method get_all_volume_usage() returns a list of items, including the instance uuid. In order to pass the results of this over to conductor (which will demand a full instance), this patch converts the structure to include it. It appears that only libvirt implements this method, and the change is fairly trivial. Related to blueprint no-db-compute-manager Change-Id: Ia8001727b57442ef0ecc2c161201f1a617e199d4 --- nova/tests/test_libvirt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py index fc8e01728..d8f6ddc1a 100644 --- a/nova/tests/test_libvirt.py +++ b/nova/tests/test_libvirt.py @@ -4419,12 +4419,12 @@ class LibvirtVolumeUsageTestCase(test.TestCase): [dict(instance=self.ins_ref, instance_bdms=self.bdms)]) expected_usage = [{'volume': 1, - 'instance_id': 1, + 'instance': self.ins_ref, 'rd_bytes': 688640L, 'wr_req': 0L, 'flush_operations': -1L, 'rd_req': 169L, 'wr_bytes': 0L}, {'volume': 2, - 'instance_id': 1, + 'instance': self.ins_ref, 'rd_bytes': 688640L, 'wr_req': 0L, 'flush_operations': -1L, 'rd_req': 169L, 'wr_bytes': 0L}]