Skip to content
Snippets Groups Projects
Commit e014fcfc authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

PEP8.

parent 2c5ad201
No related branches found
No related tags found
No related merge requests found
......@@ -20,22 +20,28 @@ if not os.path.isfile('../utils.py'):
print('conf.sh not found')
sys.exit(1)
def print_color(txt, col):
print('%s%s%s' % (col, txt, DEF))
def print_red(txt):
print_color(txt, RED)
def print_green(txt):
print_color(txt, GREEN)
all_ok = True
def get_configured_relay():
status, out = subprocess.getstatusoutput('grep relayhost /etc/postfix/main.cf')
if status == 0:
return out.split('relayhost = ')[1]
def check_relay():
global all_ok
global conf
......@@ -50,6 +56,7 @@ def check_relay():
else:
print_green('STMP relay is properly set')
def send_test_email():
print('Sending test email')
global all_ok
......@@ -64,6 +71,7 @@ def send_test_email():
else:
print_green('Email sent')
if not os.path.exists('/etc/postfix'):
print_red('Postfix dir does not exists, please install postfix.')
all_ok = False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment