]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Skip extra logging when devices is empty
authorYuanchao Sun <yuanchao.sun@gmail.com>
Sun, 9 Feb 2014 16:20:31 +0000 (00:20 +0800)
committerThomas Goirand <thomas@goirand.fr>
Thu, 13 Mar 2014 07:20:18 +0000 (15:20 +0800)
Change-Id: Id9ae8aef0555109bd88600965adb2744ab924430
Closes-Bug: #1278271

neutron/agent/securitygroups_rpc.py

index 666438b7bcf43dd29b723c800e9f04e8b1095a74..8ebf3bfe254d95286977c4b7f3d7ccb6df8df6b3 100644 (file)
@@ -150,13 +150,14 @@ class SecurityGroupAgentRpcMixin(object):
         for device in self.firewall.ports.values():
             if sec_grp_set & set(device.get(attribute, [])):
                 devices.append(device['device'])
-        if self.defer_refresh_firewall:
-            LOG.debug(_("Adding %s devices to the list of devices "
-                        "for which firewall needs to be refreshed"),
-                      devices)
-            self.devices_to_refilter |= set(devices)
-        elif devices:
-            self.refresh_firewall(devices)
+        if devices:
+            if self.defer_refresh_firewall:
+                LOG.debug(_("Adding %s devices to the list of devices "
+                            "for which firewall needs to be refreshed"),
+                          devices)
+                self.devices_to_refilter |= set(devices)
+            else:
+                self.refresh_firewall(devices)
 
     def security_groups_provider_updated(self):
         LOG.info(_("Provider rule updated"))