Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mediaserver
envsetup
Commits
b527cd0d
Commit
b527cd0d
authored
8 years ago
by
Florent Thiery
Browse files
Options
Downloads
Patches
Plain Diff
improve printing
parent
b7c7c910
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_postfix.py
+14
-8
14 additions, 8 deletions
tests/test_postfix.py
with
14 additions
and
8 deletions
tests/test_postfix.py
+
14
−
8
View file @
b527cd0d
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment