Skip to content
Snippets Groups Projects
Commit 82359003 authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Fixed celerity config check.

parent f16a65e6
No related branches found
No related tags found
No related merge requests found
......@@ -39,18 +39,18 @@ if os.path.isfile('../utils.py'):
es_utils = imp.load_source('es_utils', '../utils.py')
conf = es_utils.load_conf()
# get celerity conf
celerity_conf = ''
if os.path.exists('/etc/celerity/config.py'):
with open('/etc/celerity/config.py', 'r') as fo:
celerity_conf = fo.read()
# get enabled vhosts
resolution_ignored = conf.get('TESTER_VHOST_RESOLUTION_IGNORED', '').split(',')
requests.packages.urllib3.disable_warnings()
found = False
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):
path = os.path.join(nginx_dir, name)
with open(path, 'r') as fo:
......@@ -69,10 +69,10 @@ for name in os.listdir(nginx_dir):
continue # status vhost
found = True
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)
if name.startswith('mediaserver') and url not in celerity_conf:
sys.stdout.write('Url "%s" not found in celerity conf; it should also be set in the MediaWorker.\n' % url)
warnings = True
# test domain IP
ip_error = None
try:
......
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