From f5f2b2ef78abf7dbb80938226c74e4ee26c569fe Mon Sep 17 00:00:00 2001
From: Victor Stinner <vstinner@redhat.com>
Date: Fri, 2 Oct 2015 17:40:55 +0200
Subject: [PATCH] Port netapp SSC Cmode to Python 3

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 | 2 +-
 tox.ini                                             | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/cinder/volume/drivers/netapp/dataontap/ssc_cmode.py b/cinder/volume/drivers/netapp/dataontap/ssc_cmode.py
index 8a9a321f1..d152f8d9b 100644
--- a/cinder/volume/drivers/netapp/dataontap/ssc_cmode.py
+++ b/cinder/volume/drivers/netapp/dataontap/ssc_cmode.py
@@ -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 d86012f20..d15b8fd75 100644
--- 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 \
-- 
2.45.2