From 8fe04a8a8047294187e25ba20f288d4c2d6a5fab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Diemer?= <stephane.diemer@ubicast.eu> Date: Wed, 14 Mar 2018 08:23:55 +0100 Subject: [PATCH] Strip server values in NTP test. --- tests/test_ntp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_ntp.py b/tests/test_ntp.py index eb429796..dfd80df2 100755 --- a/tests/test_ntp.py +++ b/tests/test_ntp.py @@ -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)) -- GitLab