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'): ...@@ -20,22 +20,28 @@ if not os.path.isfile('../utils.py'):
print('conf.sh not found') print('conf.sh not found')
sys.exit(1) sys.exit(1)
def print_color(txt, col): def print_color(txt, col):
print('%s%s%s' % (col, txt, DEF)) print('%s%s%s' % (col, txt, DEF))
def print_red(txt): def print_red(txt):
print_color(txt, RED) print_color(txt, RED)
def print_green(txt): def print_green(txt):
print_color(txt, GREEN) print_color(txt, GREEN)
all_ok = True all_ok = True
def get_configured_relay(): def get_configured_relay():
status, out = subprocess.getstatusoutput('grep relayhost /etc/postfix/main.cf') status, out = subprocess.getstatusoutput('grep relayhost /etc/postfix/main.cf')
if status == 0: if status == 0:
return out.split('relayhost = ')[1] return out.split('relayhost = ')[1]
def check_relay(): def check_relay():
global all_ok global all_ok
global conf global conf
...@@ -50,6 +56,7 @@ def check_relay(): ...@@ -50,6 +56,7 @@ def check_relay():
else: else:
print_green('STMP relay is properly set') print_green('STMP relay is properly set')
def send_test_email(): def send_test_email():
print('Sending test email') print('Sending test email')
global all_ok global all_ok
...@@ -64,6 +71,7 @@ def send_test_email(): ...@@ -64,6 +71,7 @@ def send_test_email():
else: else:
print_green('Email sent') print_green('Email sent')
if not os.path.exists('/etc/postfix'): if not os.path.exists('/etc/postfix'):
print_red('Postfix dir does not exists, please install postfix.') print_red('Postfix dir does not exists, please install postfix.')
all_ok = False 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