From 2d12349eaccb221e6ffc8aea80a366b5ebaea579 Mon Sep 17 00:00:00 2001 From: "Serg G. Brester" Date: Wed, 15 Feb 2017 20:30:48 +0100 Subject: [PATCH] Update servertestcase.py Make the test-case gh-1685 compliant --- fail2ban/tests/servertestcase.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fail2ban/tests/servertestcase.py b/fail2ban/tests/servertestcase.py index aada699c..c5b997f3 100644 --- a/fail2ban/tests/servertestcase.py +++ b/fail2ban/tests/servertestcase.py @@ -1644,9 +1644,9 @@ class ServerConfigReaderTests(LogCaptureTestCase): # replace pipe to mail with pipe to cat: realCmd = re.sub(r'\)\s*\|\s*mail\b([^\n]*)', r' echo mail \1 ) | cat', realCmd) - # replace abuse retrieving (possible no-network): - realCmd = re.sub(r'[^\n]+\bADDRESSES=\$\(dig\s[^\n]+', - 'ADDRESSES="abuse-1@abuse-test-server, abuse-2@abuse-test-server"', realCmd) + # replace abuse retrieving (possible no-network), just replace first occurrence of 'dig...': + realCmd = re.sub(r'\bADDRESSES=\$\(dig\s[^\n]+', + 'ADDRESSES="abuse-1@abuse-test-server, abuse-2@abuse-test-server"', realCmd, 1) # execute action: return _actions.CommandAction.executeCmd(realCmd, timeout=timeout)