diff --git a/nova/tests/unit/virt/libvirt/fakelibvirt.py b/nova/tests/unit/virt/libvirt/fakelibvirt.py index efb41effaa14..9c2e2d0ef157 100644 --- a/nova/tests/unit/virt/libvirt/fakelibvirt.py +++ b/nova/tests/unit/virt/libvirt/fakelibvirt.py @@ -208,7 +208,7 @@ class HostInfo(object): for cell_count in range(cpu_nodes): cell = vconfig.LibvirtConfigCapsNUMACell() cell.id = cell_count - cell.memory = kb_mem / cpu_nodes + cell.memory = kb_mem // cpu_nodes for socket_count in range(cpu_sockets): for cpu_num in range(cpu_cores * cpu_threads): cpu = vconfig.LibvirtConfigCapsNUMACPU() @@ -228,7 +228,7 @@ class HostInfo(object): else: mempages = vconfig.LibvirtConfigCapsNUMAPages() mempages.size = 4 - mempages.total = cell.memory / mempages.size + mempages.total = cell.memory // mempages.size mempages = [mempages] cell.mempages = mempages topology.cells.append(cell) diff --git a/nova/tests/unit/virt/libvirt/test_fakelibvirt.py b/nova/tests/unit/virt/libvirt/test_fakelibvirt.py index e9a10c462ca0..e9fb4766b77d 100644 --- a/nova/tests/unit/virt/libvirt/test_fakelibvirt.py +++ b/nova/tests/unit/virt/libvirt/test_fakelibvirt.py @@ -386,7 +386,7 @@ class FakeLibvirtTests(test.NoDBTestCase): libvirt.VIR_CPU_COMPARE_IDENTICAL) def test_numa_topology_generation(self): - topology = """ + topology = b""" 7870000 diff --git a/nova/virt/libvirt/storage/lvm.py b/nova/virt/libvirt/storage/lvm.py index f74f3829da27..a6fc56898561 100644 --- a/nova/virt/libvirt/storage/lvm.py +++ b/nova/virt/libvirt/storage/lvm.py @@ -179,8 +179,8 @@ def _zero_volume(path, volume_size): # and caters for versions of dd that don't have # the easier to use iflag=count_bytes option. while remaining_bytes: - zero_blocks = remaining_bytes / bs - seek_blocks = (volume_size - remaining_bytes) / bs + zero_blocks = remaining_bytes // bs + seek_blocks = (volume_size - remaining_bytes) // bs zero_cmd = ('dd', 'bs=%s' % bs, 'if=/dev/zero', 'of=%s' % path, 'seek=%s' % seek_blocks, 'count=%s' % zero_blocks) @@ -189,7 +189,7 @@ def _zero_volume(path, volume_size): if zero_blocks: utils.execute(*zero_cmd, run_as_root=True) remaining_bytes %= bs - bs /= units.Ki # Limit to 3 iterations + bs //= units.Ki # Limit to 3 iterations # Use O_DIRECT with initial block size and fdatasync otherwise direct_flags = () sync_flags = ('conv=fdatasync',) diff --git a/nova/virt/libvirt/storage/rbd_utils.py b/nova/virt/libvirt/storage/rbd_utils.py index 0baff5a0e31d..92c8341bd612 100644 --- a/nova/virt/libvirt/storage/rbd_utils.py +++ b/nova/virt/libvirt/storage/rbd_utils.py @@ -182,7 +182,8 @@ class RBDDriver(object): if not url.startswith(prefix): reason = _('Not stored in rbd') raise exception.ImageUnacceptable(image_id=url, reason=reason) - pieces = map(urllib.parse.unquote, url[len(prefix):].split('/')) + pieces = [urllib.parse.unquote(piece) + for piece in url[len(prefix):].split('/')] if '' in pieces: reason = _('Blank components') raise exception.ImageUnacceptable(image_id=url, reason=reason) diff --git a/tests-py3.txt b/tests-py3.txt index 17ce6605dc6b..928d29e5f57e 100644 --- a/tests-py3.txt +++ b/tests-py3.txt @@ -52,12 +52,10 @@ nova.tests.unit.test_wsgi.TestWSGIServerWithSSL nova.tests.unit.virt.disk.mount.test_nbd.NbdTestCase nova.tests.unit.virt.ironic.test_driver.IronicDriverTestCase nova.tests.unit.virt.ironic.test_patcher.IronicDriverFieldsTestCase -nova.tests.unit.virt.libvirt.storage.test_lvm.LvmTestCase nova.tests.unit.virt.libvirt.storage.test_rbd.RbdTestCase nova.tests.unit.virt.libvirt.test_driver.LibvirtConnTestCase nova.tests.unit.virt.libvirt.test_driver.LibvirtDriverTestCase nova.tests.unit.virt.libvirt.test_driver.LibvirtVolumeSnapshotTestCase -nova.tests.unit.virt.libvirt.test_fakelibvirt.FakeLibvirtTests.test_numa_topology_generation nova.tests.unit.virt.libvirt.test_firewall.IptablesFirewallTestCase nova.tests.unit.virt.libvirt.test_imagebackend.EncryptedLvmTestCase nova.tests.unit.virt.libvirt.test_imagebackend.LvmTestCase @@ -65,7 +63,6 @@ nova.tests.unit.virt.libvirt.test_imagebackend.FlatTestCase nova.tests.unit.virt.libvirt.test_imagebackend.RbdTestCase nova.tests.unit.virt.libvirt.test_imagecache.ImageCacheManagerTestCase nova.tests.unit.virt.libvirt.test_imagecache.VerifyChecksumTestCase -nova.tests.unit.virt.libvirt.test_utils.LibvirtUtilsTestCase nova.tests.unit.virt.libvirt.test_vif.LibvirtVifTestCase nova.tests.unit.virt.test_hardware.CPUPinningCellTestCase nova.tests.unit.virt.test_hardware.CPUPinningTestCase