]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Python 3: Fix test_security_groups_db
authorCyril Roelandt <cyril@redhat.com>
Mon, 3 Aug 2015 09:56:41 +0000 (11:56 +0200)
committerCyril Roelandt <cyril@redhat.com>
Mon, 3 Aug 2015 09:56:41 +0000 (11:56 +0200)
In Python 3, Exception() is not iterable.

Change-Id: I89ffefeebb18f967129245936270318014f17f3f
Blueprint: neutron-python3

neutron/callbacks/exceptions.py
tox.ini

index f4cded227ed453e7d628590868ad6ed90eafb0ab..96dbef52abbc1139f7262c280a70553ff2506334 100644 (file)
@@ -23,7 +23,10 @@ class CallbackFailure(Exception):
         self.errors = errors
 
     def __str__(self):
-        return ','.join(str(error) for error in self.errors)
+        if isinstance(self.errors, list):
+            return ','.join(str(error) for error in self.errors)
+        else:
+            return str(self.errors)
 
 
 class NotificationError(object):
diff --git a/tox.ini b/tox.ini
index 2d3b5740829b3b7151e6862d1e472a37646ce90d..f5094b0cc1fe4fc02915c195af45580c11a50677 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -160,6 +160,7 @@ commands = python -m testtools.run \
     neutron.tests.unit.db.test_agents_db \
     neutron.tests.unit.db.quota.test_driver \
     neutron.tests.unit.db.test_dvr_mac_db \
+    neutron.tests.unit.db.test_securitygroups_db \
     neutron.tests.unit.debug.test_commands \
     neutron.tests.unit.tests.test_post_mortem_debug \
     neutron.tests.unit.tests.test_base \