Enables py3 unit tests for libvirt.host module

Python 3  '/' returns a float, while '//' returns an int.

Removes unit tests from tests-py3.txt blacklist.

Partially implements blueprint: nova-python3-mitaka

Change-Id: I87338aac1871a63dc17f1b81a7870d8911f3a399
This commit is contained in:
Claudiu Belu 2015-10-21 18:17:04 +03:00
parent 887b3c615c
commit 6aec737bb4
2 changed files with 2 additions and 3 deletions

View File

@ -943,11 +943,11 @@ class Host(object):
int(m[idx2 + 1]) +
int(m[idx3 + 1])))
# Convert it to MB
return used / units.Ki
return used // units.Ki
else:
avail = (int(m[idx1 + 1]) + int(m[idx2 + 1]) + int(m[idx3 + 1]))
# Convert it to MB
return self.get_memory_mb_total() - avail / units.Ki
return self.get_memory_mb_total() - avail // units.Ki
def get_cpu_stats(self):
"""Returns the current CPU state of the host with frequency."""

View File

@ -284,7 +284,6 @@ nova.tests.unit.virt.libvirt.test_driver.LibvirtDriverTestCase
nova.tests.unit.virt.libvirt.test_driver.LibvirtVolumeSnapshotTestCase
nova.tests.unit.virt.libvirt.test_fakelibvirt.FakeLibvirtTests
nova.tests.unit.virt.libvirt.test_firewall.IptablesFirewallTestCase
nova.tests.unit.virt.libvirt.test_host.HostTestCase
nova.tests.unit.virt.libvirt.test_imagebackend.EncryptedLvmTestCase
nova.tests.unit.virt.libvirt.test_imagebackend.LvmTestCase
nova.tests.unit.virt.libvirt.test_imagebackend.RawTestCase