From 5381151d5bbb6dc7bf2941441bf62464198607d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Diemer?= <stephane.diemer@ubicast.eu> Date: Wed, 29 Mar 2017 08:22:20 +0200 Subject: [PATCH] Fixed return code for mail test. --- tests/test_email.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_email.py b/tests/test_email.py index 70aa53a1..34314644 100755 --- a/tests/test_email.py +++ b/tests/test_email.py @@ -11,6 +11,7 @@ import random import time import imp +YELLOW = '\033[93m' GREEN = '\033[92m' RED = '\033[91m' DEF = '\033[0m' @@ -28,6 +29,10 @@ def print_color(txt, col): print('%s%s%s' % (col, txt, DEF)) +def print_yellow(txt): + print_color(txt, YELLOW) + + def print_red(txt): print_color(txt, RED) @@ -62,8 +67,8 @@ def check_relay(): with open('/etc/mailname', 'r') as f: d = f.read().strip() if d not in ('ubicast.tv', 'ubicast.eu'): - print_red('/etc/mailname does not contain ubicast.eu or ubicast.tv, mails will probably not be received on ubicast mailing lists') - return 2 + print_yellow('/etc/mailname does not contain ubicast.eu or ubicast.tv, mails will probably not be received on ubicast mailing lists') + return 3 # check spf status, output = subprocess.getstatusoutput('host -t TXT ubicast.eu') if ip not in output: -- GitLab