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
dfd1ab8f
Verified
Commit
dfd1ab8f
authored
5 years ago
by
Nicolas KAROLAK
Browse files
Options
Downloads
Patches
Plain Diff
replace os by pathlib
parent
a59ad160
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
+8
-14
8 additions, 14 deletions
tests/test_nginx_vhosts.py
with
8 additions
and
14 deletions
tests/test_nginx_vhosts.py
+
8
−
14
View file @
dfd1ab8f
...
@@ -5,8 +5,6 @@ Criticality: High
...
@@ -5,8 +5,6 @@ Criticality: High
Tests that all webserver services (vhosts) are available and reachable.
Tests that all webserver services (vhosts) are available and reachable.
"""
"""
import
imp
import
os
from
pathlib
import
Path
from
pathlib
import
Path
import
re
import
re
import
requests
import
requests
...
@@ -186,28 +184,24 @@ def main():
...
@@ -186,28 +184,24 @@ def main():
print
(
"
Check that nginx vhosts are well configured:
"
)
print
(
"
Check that nginx vhosts are well configured:
"
)
# check that Nginx dir exists
# check that Nginx dir exists
nginx_dir
=
"
/etc/nginx/sites-enabled
"
nginx_dir
=
"
/etc/nginx/sites-enabled
"
if
not
os
.
path
.
exists
(
nginx_dir
):
if
not
Path
(
nginx_dir
)
.
exists
()
:
u
.
error
(
"
nginx dir does not exists (
'
%s
'
).
"
%
nginx_dir
)
u
.
error
(
"
nginx dir does not exists (
'
%s
'
).
"
%
nginx_dir
)
sys
.
exit
(
2
)
exit
(
2
)
# check that Wowza is installed
# check that Wowza is installed
wowza_dir
=
"
/usr/local/WowzaStreamingEngine
"
wowza_dir
=
"
/usr/local/WowzaStreamingEngine
"
if
not
os
.
path
.
exists
(
wowza_dir
):
if
not
Path
(
wowza_dir
)
.
exists
()
:
u
.
info
(
"
wowza is not installed (
'
%s
'
does not exist).
"
%
wowza_dir
)
u
.
info
(
"
wowza is not installed (
'
%s
'
does not exist).
"
%
wowza_dir
)
wowza_dir
=
None
wowza_dir
=
None
else
:
else
:
u
.
info
(
"
wowza is installed, /streaming/ will be tested on mediaserver vhosts.
"
)
u
.
info
(
"
wowza is installed, /streaming/ will be tested on mediaserver vhosts.
"
)
# get envsetup conf
# get envsetup conf
conf
=
dict
()
conf
=
u
.
load_conf
()
os
.
chdir
(
os
.
path
.
dirname
(
__file__
))
if
os
.
path
.
isfile
(
"
../utils.py
"
):
es_utils
=
imp
.
load_source
(
"
es_utils
"
,
"
../utils.py
"
)
conf
=
es_utils
.
load_conf
()
# get celerity conf
# get celerity conf
celerity_conf
=
""
celerity_conf
=
""
if
os
.
path
.
exists
(
"
/etc/celerity/config.py
"
):
if
Path
(
"
/etc/celerity/config.py
"
)
.
exists
()
:
with
open
(
"
/etc/celerity/config.py
"
,
"
r
"
)
as
fo
:
with
open
(
"
/etc/celerity/config.py
"
,
"
r
"
)
as
fo
:
celerity_conf
=
fo
.
read
()
celerity_conf
=
fo
.
read
()
...
@@ -236,12 +230,12 @@ def main():
...
@@ -236,12 +230,12 @@ def main():
errors
+=
e
errors
+=
e
if
errors
:
if
errors
:
sys
.
exit
(
1
)
exit
(
1
)
elif
warnings
:
elif
warnings
:
sys
.
exit
(
3
)
exit
(
3
)
if
not
tested
:
if
not
tested
:
u
.
error
(
"
no url found in nginx sites-enabled dir
"
)
u
.
error
(
"
no url found in nginx sites-enabled dir
"
)
sys
.
exit
(
1
)
exit
(
1
)
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
...
...
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