]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Quota enforcement: python3 compatibility
authorSalvatore Orlando <salv.orlando@gmail.com>
Tue, 21 Jul 2015 10:52:09 +0000 (03:52 -0700)
committerSalvatore Orlando <salv.orlando@gmail.com>
Mon, 17 Aug 2015 23:01:12 +0000 (23:01 +0000)
This patch does a simple fix to the quota DB driver in order
to ensure its compatibility with python3 and adds the quota
enforcement unit tests to the list of those executed as a part
of the py34 test environment.

Change-Id: I9b5601632866e1fb42f860d1cca5f77b5f14f2c8
Related-blueprint: better-quotas

neutron/db/quota/driver.py
tox.ini

index a715ba53070c3cbea50e517e27070610c872b28b..3b72ffdd4ed0b85864650c37aa2d494c3d7ea59f 100644 (file)
@@ -91,6 +91,8 @@ class DbQuotaDriver(object):
 
             tenant_quota[quota['resource']] = quota['limit']
 
+        # Convert values to a list to as caller expect an indexable iterable,
+        # where python3's dict_values does not support indexing
         return list(all_tenant_quotas.values())
 
     @staticmethod
diff --git a/tox.ini b/tox.ini
index db15ec3dafdd1247247a456895e13880cd0ab774..acf7279f5035e8589051b804b80d2d4699377f1c 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -152,6 +152,8 @@ commands = python -m testtools.run \
     neutron.tests.unit.plugins.cisco.n1kv.test_n1kv_db \
     neutron.tests.unit.plugins.cisco.n1kv.fake_client \
     neutron.tests.unit.plugins.cisco.test_network_db \
+    neutron.tests.unit.quota.test_resource \
+    neutron.tests.unit.quota.test_resource_registry \
     neutron.tests.unit.scheduler.test_l3_agent_scheduler \
     neutron.tests.unit.scheduler.test_dhcp_agent_scheduler \
     neutron.tests.unit.db.test_allowedaddresspairs_db \
@@ -160,6 +162,7 @@ commands = python -m testtools.run \
     neutron.tests.unit.db.test_l3_hamode_db \
     neutron.tests.unit.db.test_migration \
     neutron.tests.unit.db.test_agents_db \
+    neutron.tests.unit.db.quota.test_api \
     neutron.tests.unit.db.quota.test_driver \
     neutron.tests.unit.db.test_dvr_mac_db \
     neutron.tests.unit.db.test_securitygroups_db \