From eb46268c8f7e3a5283dcac12d4070a02722f3f37 Mon Sep 17 00:00:00 2001 From: Yuanchao Sun Date: Mon, 10 Feb 2014 00:20:31 +0800 Subject: [PATCH] Skip extra logging when devices is empty Change-Id: Id9ae8aef0555109bd88600965adb2744ab924430 Closes-Bug: #1278271 --- neutron/agent/securitygroups_rpc.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/neutron/agent/securitygroups_rpc.py b/neutron/agent/securitygroups_rpc.py index 666438b7bc..8ebf3bfe25 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"))