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

Do not test DNS of non installed services (refs #24569).

parent a82a7148
No related branches found
No related tags found
No related merge requests found
...@@ -85,24 +85,24 @@ if not ip or ip == '0': ...@@ -85,24 +85,24 @@ if not ip or ip == '0':
print('No IP set in configuration file, unable to test DNS.') print('No IP set in configuration file, unable to test DNS.')
sys.exit(2) sys.exit(2)
conf_servers = ( services_info = (
'MS_SERVER_NAME', ('MS_SERVER_NAME', 'mediaserver', 'python3-mediaserver'),
'MONITOR_SERVER_NAME', ('MONITOR_SERVER_NAME', 'monitor', 'python3-mediaserver-monitor'),
'CM_SERVER_NAME', ('CM_SERVER_NAME', 'campusmanager', 'campus-manager'),
) )
conf_server_defaults = ( for conf_name, default_domain, package in services_info:
'mediaserver', domain = conf.get(conf_name)
'monitor', if domain and domain != default_domain:
'campusmanager', # check that the service is installed on this system
) status, output = subprocess.getstatusoutput('dpkg -s %s' % package)
if status == 0:
for s in conf_servers: print('Checking IP of "%s".' % domain)
hostname = conf.get(s) ok = check_dns(domain, ip)
if hostname not in conf_server_defaults: if not ok:
ok = check_dns(hostname, ip) all_ok = False
if not ok: else:
all_ok = False print('Package %s is not installed, IP of "%s" will not be checked.' % (package, domain))
if not all_ok: if not all_ok:
sys.exit(1) sys.exit(1)
......
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