From 3f081915316b3dcd6e958576de2ffc131c2d5192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Diemer?= <stephane.diemer@ubicast.eu> Date: Thu, 5 Jul 2018 17:38:33 +0200 Subject: [PATCH] Ignore brackets in email test. --- tests/test_email.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_email.py b/tests/test_email.py index a7b40089..05f9bbf2 100755 --- a/tests/test_email.py +++ b/tests/test_email.py @@ -68,7 +68,7 @@ def check_relay(): print('Checking if SMTP relay conforms to conf.') status, out = subprocess.getstatusoutput('grep relayhost /etc/postfix/main.cf') if status == 0: - configured_relay = out[len('relayhost'):].strip(' \t=[]') + configured_relay = out[len('relayhost'):].strip().replace('[', '').replace(']', '') else: configured_relay = '' if not configured_relay: @@ -89,7 +89,7 @@ def check_relay(): if result != 'pass': print_red('ip %s is not in ubicast.eu SPF and emails sent from support@ubicast.eu may be treated as spam' % ip) return 3 - conf_relay = conf.get('EMAIL_SMTP_SERVER', '').strip('[]') + conf_relay = conf.get('EMAIL_SMTP_SERVER', '').replace('[', '').replace(']', '') if conf_relay != configured_relay: print_red('Configured STMP relay (%s) does not match the expected value (%s).' % (configured_relay, conf_relay)) return 3 -- GitLab