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:
parent
887b3c615c
commit
6aec737bb4
@ -943,11 +943,11 @@ class Host(object):
|
|||||||
int(m[idx2 + 1]) +
|
int(m[idx2 + 1]) +
|
||||||
int(m[idx3 + 1])))
|
int(m[idx3 + 1])))
|
||||||
# Convert it to MB
|
# Convert it to MB
|
||||||
return used / units.Ki
|
return used // units.Ki
|
||||||
else:
|
else:
|
||||||
avail = (int(m[idx1 + 1]) + int(m[idx2 + 1]) + int(m[idx3 + 1]))
|
avail = (int(m[idx1 + 1]) + int(m[idx2 + 1]) + int(m[idx3 + 1]))
|
||||||
# Convert it to MB
|
# 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):
|
def get_cpu_stats(self):
|
||||||
"""Returns the current CPU state of the host with frequency."""
|
"""Returns the current CPU state of the host with frequency."""
|
||||||
|
@ -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_driver.LibvirtVolumeSnapshotTestCase
|
||||||
nova.tests.unit.virt.libvirt.test_fakelibvirt.FakeLibvirtTests
|
nova.tests.unit.virt.libvirt.test_fakelibvirt.FakeLibvirtTests
|
||||||
nova.tests.unit.virt.libvirt.test_firewall.IptablesFirewallTestCase
|
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.EncryptedLvmTestCase
|
||||||
nova.tests.unit.virt.libvirt.test_imagebackend.LvmTestCase
|
nova.tests.unit.virt.libvirt.test_imagebackend.LvmTestCase
|
||||||
nova.tests.unit.virt.libvirt.test_imagebackend.RawTestCase
|
nova.tests.unit.virt.libvirt.test_imagebackend.RawTestCase
|
||||||
|
Loading…
Reference in New Issue
Block a user