From 09324277aec6c09d981fe255270be5ab10577329 Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Tue, 21 Jul 2015 03:52:09 -0700 Subject: [PATCH] Quota enforcement: python3 compatibility 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 | 2 ++ tox.ini | 3 +++ 2 files changed, 5 insertions(+) diff --git a/neutron/db/quota/driver.py b/neutron/db/quota/driver.py index a715ba53070..3b72ffdd4ed 100644 --- a/neutron/db/quota/driver.py +++ b/neutron/db/quota/driver.py @@ -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 db15ec3dafd..acf7279f503 100644 --- 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 \