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

Strip server values in NTP test.

parent d24605bd
No related branches found
No related tags found
No related merge requests found
......@@ -36,14 +36,14 @@ print('Checking NTP server conforms to conf')
if os.path.isfile('../utils.py'):
es_utils = imp.load_source('es_utils', '../utils.py')
conf = es_utils.load_conf()
expected_servers = (conf.get('NTP_SERVER') or 'ntp.ubuntu.com').split(',')
expected_servers = [s.strip() for s in (conf.get('NTP_SERVER') or 'ntp.ubuntu.com').split(',')]
with open(ntpconf, 'r') as f:
d = f.read()
servers = list()
for l in d.split('\n'):
if l.startswith(ntpconf_expected):
servers.append(l[len(ntpconf_expected):])
servers.append(l[len(ntpconf_expected):].strip())
for expected_server in expected_servers:
if expected_server not in servers:
print('Expected NTP server %s not found in %s, found %s instead.' % (expected_server, ntpconf, servers))
......
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