summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2015-10-23 15:35:55 +0200
committerDavid Sommerseth <davids@redhat.com>2015-10-23 15:35:55 +0200
commitd2df60c6cccc5a7aa10d311beb1528c08f505309 (patch)
treeaa399cf173750e44d778697d6402c92b3577f96f
parent5b460a78e9ea685a628e990c2efaa20e28bb2023 (diff)
downloadlogactio-d2df60c6cccc5a7aa10d311beb1528c08f505309.tar.gz
logactio-d2df60c6cccc5a7aa10d311beb1528c08f505309.tar.xz
logactio-d2df60c6cccc5a7aa10d311beb1528c08f505309.zip
IPTipset: Delay exit of __cleanup_iptables()
It may happen on some systems that the iptables command line have completed removing ipset rules, but things aren't quite yet ready. This adds a 5 seconds delay before ipset tries to remove the ipset list. Signed-off-by: David Sommerseth <davids@redhat.com>
-rw-r--r--LogActio/Reporters/IPTipset.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/LogActio/Reporters/IPTipset.py b/LogActio/Reporters/IPTipset.py
index 37fd595..97539c9 100644
--- a/LogActio/Reporters/IPTipset.py
+++ b/LogActio/Reporters/IPTipset.py
@@ -24,7 +24,7 @@
# are deemed to be part of the source code.
#
-import sys, os, subprocess, tempfile, re
+import sys, os, subprocess, tempfile, re, time
import LogActio.Message, LogActio.ReporterQueue
@@ -287,6 +287,7 @@ class IPTipset(LogActio.ReporterQueue.ReporterQueue):
# Clean up
os.close(nullfp)
del nullfp
+ time.sleep(5) # Allow iptables to complete its job before indicating we're done
def __processqueue(self):