]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Don't log a warning if an iptables chain doesn't exist
authorBrian Haley <brian.haley@hp.com>
Thu, 18 Dec 2014 21:02:10 +0000 (16:02 -0500)
committerBrian Haley <brian.haley@hp.com>
Thu, 15 Jan 2015 21:30:57 +0000 (21:30 +0000)
The iptables_manager remove_chain() function calls LOG.warn()
if asked to remove a chain that it doesn't know about.  This
is spamming the neutron-full gate job pretty bad.  Change to
LOG.debug() since reverting the change that caused it is
difficult since the FWaaS code has been split-out from the
tree.

Introduced in change 6eee93a98c67

Change-Id: Ieb20ae01137223110abf3c933e4981ff39055398
Closes-bug: #1404016

neutron/agent/linux/iptables_manager.py
neutron/tests/unit/test_iptables_manager.py

index ce8dae3651d6bffb214f4fc7243b44f6726a5c69..59d416cc88058e907c526b34597d47874f32510d 100644 (file)
@@ -152,8 +152,8 @@ class IptablesTable(object):
         chain_set = self._select_chain_set(wrap)
 
         if name not in chain_set:
-            LOG.warn(_LW('Attempted to remove chain %s which does not exist'),
-                     name)
+            LOG.debug('Attempted to remove chain %s which does not exist',
+                      name)
             return
 
         chain_set.remove(name)
index 54fcf76ddc45df02d2ccd8d49c3e097147892915..b4664ad6923cf4b159002a3e70efc5878c1c3b4f 100644 (file)
@@ -803,7 +803,7 @@ class IptablesManagerStateFulTestCase(base.BaseTestCase):
     def test_remove_nonexistent_chain(self):
         with mock.patch.object(iptables_manager, "LOG") as log:
             self.iptables.ipv4['filter'].remove_chain('nonexistent')
-        log.warn.assert_called_once_with(
+        log.debug.assert_called_once_with(
             'Attempted to remove chain %s which does not exist',
             'nonexistent')