diff --git a/neutron_fwaas/extensions/firewall.py b/neutron_fwaas/extensions/firewall.py index f1c5a0cec..013a24eff 100644 --- a/neutron_fwaas/extensions/firewall.py +++ b/neutron_fwaas/extensions/firewall.py @@ -102,6 +102,7 @@ def convert_to_string(value): return str(value) return None + firewall.RESOURCE_ATTRIBUTE_MAP[api_const.FIREWALL_RULES][ 'source_port']['convert_to'] = convert_to_string firewall.RESOURCE_ATTRIBUTE_MAP[api_const.FIREWALL_RULES][ diff --git a/neutron_fwaas/extensions/firewall_v2.py b/neutron_fwaas/extensions/firewall_v2.py index 25aff1578..372b9d716 100644 --- a/neutron_fwaas/extensions/firewall_v2.py +++ b/neutron_fwaas/extensions/firewall_v2.py @@ -93,6 +93,7 @@ def convert_to_string(value): return str(value) return None + firewall_v2.RESOURCE_ATTRIBUTE_MAP[api_const.FIREWALL_RULES][ 'source_port']['convert_to'] = convert_to_string firewall_v2.RESOURCE_ATTRIBUTE_MAP[api_const.FIREWALL_RULES][ diff --git a/neutron_fwaas/services/firewall/service_drivers/agents/drivers/linux/iptables_fwaas_v2.py b/neutron_fwaas/services/firewall/service_drivers/agents/drivers/linux/iptables_fwaas_v2.py index e51641e9b..60efcb7fe 100644 --- a/neutron_fwaas/services/firewall/service_drivers/agents/drivers/linux/iptables_fwaas_v2.py +++ b/neutron_fwaas/services/firewall/service_drivers/agents/drivers/linux/iptables_fwaas_v2.py @@ -473,7 +473,7 @@ class IptablesFwaasDriver(fwaas_base_v2.FwaasDriverBase): # or destination port number is specified if (rule.get('source_port') is not None or rule.get('destination_port') is not None): - args += self._match_arg(rule.get('protocol')) + args += self._match_arg(rule.get('protocol')) args += self._port_arg('sport', rule.get('protocol'), diff --git a/neutron_fwaas/services/firewall/service_drivers/agents/l3reference/firewall_l3_agent_v2.py b/neutron_fwaas/services/firewall/service_drivers/agents/l3reference/firewall_l3_agent_v2.py index ee2d3c3fa..fa5cbb95c 100644 --- a/neutron_fwaas/services/firewall/service_drivers/agents/l3reference/firewall_l3_agent_v2.py +++ b/neutron_fwaas/services/firewall/service_drivers/agents/l3reference/firewall_l3_agent_v2.py @@ -297,8 +297,8 @@ class FWaaSL3AgentExtension(l3_extension.L3AgentExtension): self.services_sync_needed = True def update_router(self, context, updated_router): - """Handles agent restart and router update. Fetches firewall groups from - plugin and updates driver. + """Handles agent restart and router update. Fetches firewall groups + from plugin and updates driver. """ if not self.fwaas_enabled: return diff --git a/neutron_fwaas/tests/functional/services/logapi/agents/drivers/iptables/test_log.py b/neutron_fwaas/tests/functional/services/logapi/agents/drivers/iptables/test_log.py index d148ae185..e7409a7ff 100644 --- a/neutron_fwaas/tests/functional/services/logapi/agents/drivers/iptables/test_log.py +++ b/neutron_fwaas/tests/functional/services/logapi/agents/drivers/iptables/test_log.py @@ -239,8 +239,8 @@ class FWLoggingTestBase(framework.L3AgentTestFramework): with mock.patch.object(self.resource_rpc, 'get_sg_log_info_for_port', return_value=log_info): - self.log_driver.start_logging(self.context, - router_info=router_info) + self.log_driver.start_logging(self.context, + router_info=router_info) elif log_resources: with mock.patch.object(self.resource_rpc, 'get_sg_log_info_for_log_resources', diff --git a/test-requirements.txt b/test-requirements.txt index 926bcb3c2..e0f78bf03 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,7 +1,7 @@ # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 +hacking>=1.1.0,<1.2.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 flake8-import-order==0.12 # LGPLv3 diff --git a/tox.ini b/tox.ini index 0b0d47598..4f7492dbc 100644 --- a/tox.ini +++ b/tox.ini @@ -154,7 +154,10 @@ ignore-path = .venv,.git,.tox,.tmp,*neutron_fwaas/locale*,*lib/python*,neutron_f # H205: Use assert(Greater|Less)(Equal) for comparison # H904: Delay string interpolations at logging calls # N521: jsonutils.loads must be used instead of json.loads -ignore = E125,E126,E128,E129,E265,H404,H405,N530,N521 +# W504 line break after binary operator +# (W503 and W504 are incompatible and we need to choose one of them. +# Existing codes follows W503, so we disable W504.) +ignore = E125,E126,E128,E129,E265,H404,H405,N530,N521,W504 enable-extensions=H106,H203,H204,H205,H904 show-source = true exclude = .venv,.git,.tox,dist,doc,*lib/python*,.tmp,*egg,build,tools,.ropeproject,rally-scenarios