]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Update _cur names to _current in iptables_firewall.py
authorMiguel Angel Ajo <mangelajo@redhat.com>
Sun, 18 Jan 2015 08:35:55 +0000 (08:35 +0000)
committerMiguel Angel Ajo <mangelajo@redhat.com>
Tue, 20 Jan 2015 14:09:27 +0000 (14:09 +0000)
_cur names were obscure, their actual meaning was _current.

Partially implements blueprint refactor-iptables-firewall-driver

Change-Id: I80df11d845bea5f683b9910fb1020a3f9c04a648

neutron/agent/linux/iptables_firewall.py

index 63b0c4ab60f0620f38d613c4797a6518a72dbb34..eb015cdcfd7951e2102a96e90f6e1e2e9b5c2d19 100644 (file)
@@ -366,15 +366,15 @@ class IptablesFirewallDriver(firewall.FirewallDriver):
                             ipv6_iptables_rules)
         self._drop_dhcp_rule(ipv4_iptables_rules, ipv6_iptables_rules)
 
-    def _get_cur_sg_member_ips(self, sg_id, ethertype):
+    def _get_current_sg_member_ips(self, sg_id, ethertype):
         return self.sg_members.get(sg_id, {}).get(ethertype, [])
 
     def _update_ipset_members(self, security_group_ids):
         for ethertype, sg_ids in security_group_ids.items():
             for sg_id in sg_ids:
-                cur_member_ips = self._get_cur_sg_member_ips(sg_id, ethertype)
-                if cur_member_ips:
-                    self.ipset.set_members(sg_id, ethertype, cur_member_ips)
+                current_ips = self._get_current_sg_member_ips(sg_id, ethertype)
+                if current_ips:
+                    self.ipset.set_members(sg_id, ethertype, current_ips)
 
     def _generate_ipset_chain(self, sg_rule, remote_gid):
         iptables_rules = []
@@ -502,21 +502,21 @@ class IptablesFirewallDriver(firewall.FirewallDriver):
         need_removed_security_groups = set()
         remote_group_ids = {constants.IPv4: set(),
                             constants.IPv6: set()}
-        cur_group_ids = set()
+        current_group_ids = set()
         for port in self.filtered_ports.values():
             for direction in INGRESS_DIRECTION, EGRESS_DIRECTION:
                 for ethertype, sg_ids in self._get_remote_sg_ids(
                         port, direction).items():
                     remote_group_ids[ethertype].update(sg_ids)
             groups = port.get('security_groups', [])
-            cur_group_ids.update(groups)
+            current_group_ids.update(groups)
 
         for ethertype in [constants.IPv4, constants.IPv6]:
             need_removed_ipsets[ethertype].update(
                 [x for x in self.pre_sg_members if x not in remote_group_ids[
                     ethertype]])
             need_removed_security_groups.update(
-                [x for x in self.pre_sg_rules if x not in cur_group_ids])
+                [x for x in self.pre_sg_rules if x not in current_group_ids])
 
         # Remove unused ip sets (sg_members and kernel ipset if we
         # are using ipset)