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
95544c63
Commit
95544c63
authored
7 years ago
by
Nicolas KAROLAK
Browse files
Options
Downloads
Patches
Plain Diff
set 127.0.0.1 alerts to warnings instead of errors
parent
5b3569a0
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_nginx_vhosts.py
+11
-1
11 additions, 1 deletion
tests/test_nginx_vhosts.py
with
11 additions
and
1 deletion
tests/test_nginx_vhosts.py
+
11
−
1
View file @
95544c63
...
...
@@ -74,13 +74,14 @@ for name in os.listdir(nginx_dir):
warnings
=
True
# test domain IP
ip_error
=
None
ip_warning
=
None
try
:
ip
=
socket
.
gethostbyname
(
domain
)
except
Exception
as
e
:
ip_error
=
'
domain is not resolved: %s
'
%
e
else
:
if
ip
!=
'
127.0.0.1
'
:
ip_
error
=
'
domain is resolved with %s instead of 127.0.0.1
'
%
ip
ip_
warning
=
'
domain is resolved with %s instead of 127.0.0.1
'
%
ip
sys
.
stdout
.
write
(
'
IP:
'
)
if
ip_error
:
if
domain
in
resolution_ignored
:
...
...
@@ -88,6 +89,12 @@ for name in os.listdir(nginx_dir):
ip_error
=
None
else
:
sys
.
stdout
.
write
(
'
\033
[91mKO (%s)
\033
[0m
'
%
ip_error
)
elif
ip_warning
:
if
domain
in
resolution_ignored
:
sys
.
stdout
.
write
(
'
\033
[94mIgnored (%s)
\033
[0m
'
%
ip_warning
)
ip_warning
=
None
else
:
sys
.
stdout
.
write
(
'
\033
[91mWarning (%s)
\033
[0m
'
%
ip_warning
)
else
:
sys
.
stdout
.
write
(
'
\033
[92mOK (127.0.0.1)
\033
[0m
'
)
# test url
...
...
@@ -120,6 +127,9 @@ for name in os.listdir(nginx_dir):
sys
.
stdout
.
write
(
'
\033
[92mOK (%s)
\033
[0m
'
%
code
)
sys
.
stdout
.
write
(
'
.
\n
'
)
if
ip_warning
:
warnings
+=
1
if
ip_error
or
req_error
:
errors
+=
1
...
...
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