summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-06-19 14:57:38 +0000
committerGerrit Code Review <review@openstack.org>2017-06-19 14:57:39 +0000
commitf673ef3c23af2e7a5f180800ae5b8b1fc84dd73a (patch)
tree01c429a6f23573e6f4cbe10482239e0a30192bbc
parent31f5b6431f7b7885ae00dd535522f76b77b7b9cd (diff)
parentb360565c49a12e34f89838147fe00bfdf9786b71 (diff)
Merge "Refactor find iptables rules"
-rw-r--r--neutron_fwaas/services/firewall/drivers/linux/iptables_fwaas.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/neutron_fwaas/services/firewall/drivers/linux/iptables_fwaas.py b/neutron_fwaas/services/firewall/drivers/linux/iptables_fwaas.py
index 73bb443..510f948 100644
--- a/neutron_fwaas/services/firewall/drivers/linux/iptables_fwaas.py
+++ b/neutron_fwaas/services/firewall/drivers/linux/iptables_fwaas.py
@@ -266,15 +266,11 @@ class IptablesFwaasDriver(fwaas_base.FwaasDriverBase):
266 return changed_rules 266 return changed_rules
267 267
268 def _find_removed_rules(self, pre_firewall, firewall): 268 def _find_removed_rules(self, pre_firewall, firewall):
269 removed_rules = []
270 fw_rules_list = firewall[f_const.FIREWALL_RULE_LIST] 269 fw_rules_list = firewall[f_const.FIREWALL_RULE_LIST]
271 pre_fw_rules_list = pre_firewall[f_const.FIREWALL_RULE_LIST] 270 pre_fw_rules_list = pre_firewall[f_const.FIREWALL_RULE_LIST]
272 fw_rule_ids = [] 271 fw_rule_ids = [fw_rule.get('id') for fw_rule in fw_rules_list]
273 for fw_rule in fw_rules_list: 272 removed_rules = [pre_fw_rule for pre_fw_rule in
274 fw_rule_ids.append(fw_rule.get('id')) 273 pre_fw_rules_list if pre_fw_rule.get('id') not in fw_rule_ids]
275 for pre_fw_rule in pre_fw_rules_list:
276 if pre_fw_rule.get('id') not in fw_rule_ids:
277 removed_rules.append(pre_fw_rule)
278 return removed_rules 274 return removed_rules
279 275
280 def _find_new_rules(self, pre_firewall, firewall): 276 def _find_new_rules(self, pre_firewall, firewall):