From 9ddc8394d4394a83782495b1a19b3e3a3614a0ae Mon Sep 17 00:00:00 2001 From: Y Date: Fri, 2 Feb 2018 08:12:04 +0100 Subject: [PATCH] action_nftBan: do not fail on delete; only on add --- pyruse/actions/action_nftBan.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pyruse/actions/action_nftBan.py b/pyruse/actions/action_nftBan.py index 6d71e7b..cd1f8d7 100644 --- a/pyruse/actions/action_nftBan.py +++ b/pyruse/actions/action_nftBan.py @@ -41,9 +41,12 @@ class Action(base.Action): pass # new file if previousTS: - cmd = list(Action._nft) - cmd.append("delete element %s {%s}" % (nftSet, ip)) - subprocess.run(cmd) + try: + cmd = list(Action._nft) + cmd.append("delete element %s {%s}" % (nftSet, ip)) + subprocess.run(cmd) + except Exception: + pass # too late: not a problem until = self._doBan(now, ip, nftSet)