From: Victor Stinner Date: Mon, 17 Aug 2015 17:25:27 +0000 (-0700) Subject: Port image_utils to Python 3 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=d95bd7c37666c849e2e6283b2269ec0ef8d2fd10;p=openstack-build%2Fcinder-build.git Port image_utils to Python 3 Port cinder.image_utils.check_qemu_img_version() to Python 3. Add the following tests to Python 3.4 in tox.ini: * cinder.tests.unit.test_image_utils * cinder.tests.unit.test_migrations * cinder.tests.unit.test_misc * cinder.tests.unit.test_service Partially implements: blueprint cinder-python3 Change-Id: I69feda94c90206adc8771fbd5ddc6aae5bb6b64b --- diff --git a/cinder/image/image_utils.py b/cinder/image/image_utils.py index 81f521d79..476ab1403 100644 --- a/cinder/image/image_utils.py +++ b/cinder/image/image_utils.py @@ -80,7 +80,8 @@ def _get_version_from_string(version_string): def check_qemu_img_version(minimum_version): qemu_version = get_qemu_img_version() - if qemu_version < _get_version_from_string(minimum_version): + if (qemu_version is None + or qemu_version < _get_version_from_string(minimum_version)): if qemu_version: current_version = '.'.join((str(element) for element in qemu_version)) diff --git a/tox.ini b/tox.ini index b026e036b..be9246ed6 100644 --- a/tox.ini +++ b/tox.ini @@ -74,7 +74,10 @@ commands = cinder.tests.unit.test_ibm_flashsystem_iscsi \ cinder.tests.unit.test_ibmnas \ cinder.tests.unit.test_ibm_xiv_ds8k \ + cinder.tests.unit.test_image_utils \ cinder.tests.unit.test_infortrend_cli \ + cinder.tests.unit.test_migrations \ + cinder.tests.unit.test_misc \ cinder.tests.unit.test_netapp_nfs \ cinder.tests.unit.test_nfs \ cinder.tests.unit.test_nimble \ @@ -85,6 +88,7 @@ commands = cinder.tests.unit.test_replication \ cinder.tests.unit.test_san \ cinder.tests.unit.test_scality \ + cinder.tests.unit.test_service \ cinder.tests.unit.test_sheepdog \ cinder.tests.unit.test_smbfs \ cinder.tests.unit.test_solidfire \