From f68cd4fa2f3a75a2377a9e84f489580ac723b615 Mon Sep 17 00:00:00 2001 From: "Kyle L. Henderson" Date: Thu, 4 Jun 2015 10:02:32 -0500 Subject: [PATCH] Fixes for Python 3 Nova is working on support for Python 3.4. via https://blueprints.launchpad.net/nova/+spec/nova-python3 This changeset moves from py33 to py34 in the tox.ini file to be inline with Nova. It also incorporates changes produced from the 'sixer' tool run with 'all'. sixer can be found at: https://pypi.python.org/pypi/sixer At the present time, the py34 environment does not run successfully because it pulls in portions of Nova that have not yet been fully converted to Python 3. Change-Id: If84df3017a722d0ad3546e81f97e67f1a07a763f --- nova_powervm/tests/virt/powervm/disk/test_localdisk.py | 2 +- nova_powervm/virt/powervm/disk/driver.py | 2 +- tox.ini | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nova_powervm/tests/virt/powervm/disk/test_localdisk.py b/nova_powervm/tests/virt/powervm/disk/test_localdisk.py index 8011e18b..c170d6fe 100644 --- a/nova_powervm/tests/virt/powervm/disk/test_localdisk.py +++ b/nova_powervm/tests/virt/powervm/disk/test_localdisk.py @@ -91,7 +91,7 @@ class TestLocalDisk(test.TestCase): None, inst, mock_img, 20) mock_upload_vdisk.assert_called_with(mock.ANY, mock.ANY, mock.ANY, mock.ANY, 'b_Inst_Nam_d506', 50, - d_size=21474836480L) + d_size=21474836480) self.assertEqual('vdisk', vdisk) @mock.patch('pypowervm.wrappers.storage.VG') diff --git a/nova_powervm/virt/powervm/disk/driver.py b/nova_powervm/virt/powervm/disk/driver.py index 9a3f9ae8..4e117fc5 100644 --- a/nova_powervm/virt/powervm/disk/driver.py +++ b/nova_powervm/virt/powervm/disk/driver.py @@ -63,7 +63,7 @@ class IterableToFileAdapter(object): chunk = self.remaining_data try: while not chunk: - chunk = self.iterator.next() + chunk = next(self.iterator) except StopIteration: return '' return_value = chunk[0:size] diff --git a/tox.ini b/tox.ini index 347e6a8a..738abaa4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 1.6 -envlist = py33,py27,pep8 +envlist = py34,py27,pep8 skipsdist = True [testenv]