]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Port netapp SSC Cmode to Python 3
authorVictor Stinner <vstinner@redhat.com>
Fri, 2 Oct 2015 15:40:55 +0000 (17:40 +0200)
committerVictor Stinner <vstinner@redhat.com>
Fri, 2 Oct 2015 15:48:28 +0000 (17:48 +0200)
Fix query_cluster_vols_for_ssc(): cast string (records) to int. On
Python 3, comparison between str and int now raise a TypeError.

tox.ini: add cinder.tests.unit.test_netapp_ssc to Python 3.4.

Partial-Implements: blueprint cinder-python3
Change-Id: I05127340029a5bb6c8444f51341be8008aab8dc8

cinder/volume/drivers/netapp/dataontap/ssc_cmode.py
tox.ini

index 8a9a321f1ae7f4b87559b9cad6cc322285cc5e63..d152f8d9b8c0d87966e44d5bc739305d76175140 100644 (file)
@@ -173,7 +173,7 @@ def query_cluster_vols_for_ssc(na_server, vserver, volume=None):
     vols = set()
     for res in result:
         records = res.get_child_content('num-records')
-        if records > 0:
+        if int(records) > 0:
             attr_list = res.get_child_by_name('attributes-list')
             if attr_list:
                 vol_attrs = attr_list.get_children()
diff --git a/tox.ini b/tox.ini
index d86012f2008a58612f8d1e0d4c680411ec792319..d15b8fd757ea8b5553cc89e2a2f199e2f713e991 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -80,6 +80,7 @@ commands =
     cinder.tests.unit.test_migrations \
     cinder.tests.unit.test_misc \
     cinder.tests.unit.test_netapp_nfs \
+    cinder.tests.unit.test_netapp_ssc \
     cinder.tests.unit.test_nfs \
     cinder.tests.unit.test_nimble \
     cinder.tests.unit.test_pure \