Python 3: Fix a TypeError in policy.py

Fix "TypeError: 'filter' object is not subscriptable" with python 3.

Blueprint: neutron-python3
Change-Id: Ia49ce2e283ecf4da5333b95006746cb19490fde4
This commit is contained in:
YAMAMOTO Takashi 2015-07-09 16:26:10 +09:00
parent fb21626a86
commit 4cd4b612c0
2 changed files with 2 additions and 1 deletions

View File

@ -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)

View File

@ -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 \