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
da674847
Commit
da674847
authored
8 years ago
by
Florent Thiery
Browse files
Options
Downloads
Patches
Plain Diff
detect if a ms vhost is not in the celerity conf, refs
#20845
parent
c12ca399
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_nginx_vhosts.py
+13
-1
13 additions, 1 deletion
tests/test_nginx_vhosts.py
with
13 additions
and
1 deletion
tests/test_nginx_vhosts.py
+
13
−
1
View file @
da674847
...
@@ -44,6 +44,13 @@ resolution_ignored = conf.get('TESTER_VHOST_RESOLUTION_IGNORED', '').split(',')
...
@@ -44,6 +44,13 @@ resolution_ignored = conf.get('TESTER_VHOST_RESOLUTION_IGNORED', '').split(',')
requests
.
packages
.
urllib3
.
disable_warnings
()
requests
.
packages
.
urllib3
.
disable_warnings
()
found
=
False
found
=
False
errors
=
0
errors
=
0
warnings
=
False
def
check_celerity_conf
(
url
):
with
open
(
'
/etc/celerity/config.py
'
,
'
r
'
)
as
f
:
d
=
f
.
read
()
return
url
in
d
for
name
in
os
.
listdir
(
nginx_dir
):
for
name
in
os
.
listdir
(
nginx_dir
):
path
=
os
.
path
.
join
(
nginx_dir
,
name
)
path
=
os
.
path
.
join
(
nginx_dir
,
name
)
with
open
(
path
,
'
r
'
)
as
fo
:
with
open
(
path
,
'
r
'
)
as
fo
:
...
@@ -62,6 +69,9 @@ for name in os.listdir(nginx_dir):
...
@@ -62,6 +69,9 @@ for name in os.listdir(nginx_dir):
continue
# status vhost
continue
# status vhost
found
=
True
found
=
True
url
=
'
%s://%s
'
%
(
'
https
'
if
https
else
'
http
'
,
domain
)
url
=
'
%s://%s
'
%
(
'
https
'
if
https
else
'
http
'
,
domain
)
if
name
.
startswith
(
'
mediaserver
'
)
and
not
check_celerity_conf
(
url
):
sys
.
stdout
.
write
(
'
Url %s not found in celerity conf; is should also be set in the MediaWorker
\n
'
%
url
)
warnings
=
True
sys
.
stdout
.
write
(
'
Testing url
"
%s
"
:
\n
'
%
url
)
sys
.
stdout
.
write
(
'
Testing url
"
%s
"
:
\n
'
%
url
)
# test domain IP
# test domain IP
ip_error
=
None
ip_error
=
None
...
@@ -118,8 +128,10 @@ for name in os.listdir(nginx_dir):
...
@@ -118,8 +128,10 @@ for name in os.listdir(nginx_dir):
errors
+=
1
errors
+=
1
if
errors
:
if
errors
:
print
(
'
%s vhost(s) did not correctly respond
ed
.
'
%
errors
)
print
(
'
%s vhost(s) did not correctly respond.
'
%
errors
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
elif
warnings
:
sys
.
exit
(
3
)
if
not
found
:
if
not
found
:
print
(
'
No vhost found in Nginx sites-enabled dir.
'
)
print
(
'
No vhost found in Nginx sites-enabled dir.
'
)
sys
.
exit
(
1
)
sys
.
exit
(
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