]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Port image_utils to Python 3
authorVictor Stinner <vstinner@redhat.com>
Mon, 17 Aug 2015 17:25:27 +0000 (10:25 -0700)
committerVictor Stinner <vstinner@redhat.com>
Tue, 1 Sep 2015 11:20:40 +0000 (13:20 +0200)
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

cinder/image/image_utils.py
tox.ini

index 81f521d79b542c0529cfff861da5652acd861b2b..476ab1403aa04974605c3ef56e7839e0ce0fb01e 100644 (file)
@@ -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 b026e036b0fd36e9a9b33de493d0add14df9ff55..be9246ed6d4e5d68278e0b93544c4254818bd449 100644 (file)
--- 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 \