Skip to content
Snippets Groups Projects
Commit b527cd0d authored by Florent Thiery's avatar Florent Thiery
Browse files

improve printing

parent b7c7c910
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,11 @@ GREEN = '\033[92m'
RED = '\033[91m'
DEF = '\033[0m'
os.chdir(os.path.dirname(__file__))
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))
......@@ -33,16 +38,17 @@ def get_configured_relay():
def check_relay():
global all_ok
global conf
configured_relay = get_configured_relay()
print('Checking if SMTP relay conforms to conf')
if os.path.isfile('../utils.py'):
es_utils = imp.load_source('es_utils', '../utils.py')
conf = es_utils.load_conf()
conf_relay = conf.get('EMAIL_SMTP_SERVER')
if conf_relay != configured_relay:
print_red('Configured STMP relay (%s) does not match the expected value (%s)' % (configured_relay, conf_relay))
all_ok = False
es_utils = imp.load_source('es_utils', '../utils.py')
conf = es_utils.load_conf()
conf_relay = conf.get('EMAIL_SMTP_SERVER')
if conf_relay != configured_relay:
print_red('Configured STMP relay (%s) does not match the expected value (%s)' % (configured_relay, conf_relay))
all_ok = False
else:
print_green('STMP relay is properly set')
def send_test_email():
global all_ok
......
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