From: YAMAMOTO Takashi Date: Thu, 9 Jul 2015 07:26:10 +0000 (+0900) Subject: Python 3: Fix a TypeError in policy.py X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=4cd4b612c0ad6a0719f0188e4724a21c3b83f490;p=openstack-build%2Fneutron-build.git Python 3: Fix a TypeError in policy.py Fix "TypeError: 'filter' object is not subscriptable" with python 3. Blueprint: neutron-python3 Change-Id: Ia49ce2e283ecf4da5333b95006746cb19490fde4 --- diff --git a/neutron/policy.py b/neutron/policy.py index 496094a11..c3f6746bb 100644 --- a/neutron/policy.py +++ b/neutron/policy.py @@ -111,7 +111,7 @@ def _build_subattr_match_rule(attr_name, attr, action, target): # typing for API attributes # Expect a dict as type descriptor validate = attr['validate'] - key = filter(lambda k: k.startswith('type:dict'), validate.keys()) + key = list(filter(lambda k: k.startswith('type:dict'), validate.keys())) if not key: LOG.warn(_LW("Unable to find data type descriptor for attribute %s"), attr_name) diff --git a/tox.ini b/tox.ini index 19dbef457..f473cd350 100644 --- a/tox.ini +++ b/tox.ini @@ -195,6 +195,7 @@ commands = python -m testtools.run \ neutron.tests.unit.agent.linux.test_ip_link_support \ neutron.tests.unit.agent.linux.test_interface \ neutron.tests.unit.test_auth \ + neutron.tests.unit.test_policy \ neutron.tests.unit.extensions.v2attributes \ neutron.tests.unit.extensions.test_l3_ext_gw_mode \ neutron.tests.unit.extensions.test_extra_dhcp_opt \