From: Yuanchao Sun Date: Sun, 9 Feb 2014 16:20:31 +0000 (+0800) Subject: Skip extra logging when devices is empty X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=41d87d4cb0c1989e4c5a541fec91ad6ee2bf2181;p=openstack-build%2Fneutron-build.git Skip extra logging when devices is empty Change-Id: Id9ae8aef0555109bd88600965adb2744ab924430 Closes-Bug: #1278271 --- diff --git a/neutron/agent/securitygroups_rpc.py b/neutron/agent/securitygroups_rpc.py index 666438b7b..8ebf3bfe2 100644 --- a/neutron/agent/securitygroups_rpc.py +++ b/neutron/agent/securitygroups_rpc.py @@ -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"))