From 1985b176adff8252886c09f36c075af4144cb95f Mon Sep 17 00:00:00 2001 From: kirankv Date: Fri, 17 May 2013 07:14:44 -0700 Subject: Fix VMwareVCdriver reporting incorrect stats fix bug #1180779 VMware nova compute drivers VMwareESXDriver and VMwareVCDriver currently report stats for the column local_gb in MB instead of in GB The fix would be to modify vmwareapi/host.py to ensure the values reported for disk space are calculated in GB instead of MB. Fix is done by further dividing the existing MB value by 1024 to convert to GB. The unit tests to check for capacity and freespace have been modified to check for GB. Change-Id: I0610047ee2bddefe0ccb46568c0f48de4c0941af --- nova/tests/virt/vmwareapi/test_vmwareapi_vm_util.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'nova/tests') diff --git a/nova/tests/virt/vmwareapi/test_vmwareapi_vm_util.py b/nova/tests/virt/vmwareapi/test_vmwareapi_vm_util.py index eda2c25f9..123a314c1 100644 --- a/nova/tests/virt/vmwareapi/test_vmwareapi_vm_util.py +++ b/nova/tests/virt/vmwareapi/test_vmwareapi_vm_util.py @@ -1,5 +1,6 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# + +# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # Copyright 2013 Canonical Corp. # All Rights Reserved. # @@ -41,8 +42,8 @@ class VMwareVMUtilTestCase(test.TestCase): fake_session([fake.Datastore()])) self.assertEquals(result[1], "fake-ds") - self.assertEquals(result[2], 1024 * 1024 * 1024) - self.assertEquals(result[3], 1024 * 1024 * 500) + self.assertEquals(result[2], 1024 * 1024 * 1024 * 1024) + self.assertEquals(result[3], 1024 * 1024 * 500 * 1024) def test_get_datastore_ref_and_name_without_datastore(self): -- cgit