Skip to content
Snippets Groups Projects
Commit 53cb03b0 authored by Nicolas KAROLAK's avatar Nicolas KAROLAK
Browse files

remove useless check on utils.py file

parent c081825e
No related branches found
No related tags found
No related merge requests found
...@@ -37,15 +37,8 @@ def main(): ...@@ -37,15 +37,8 @@ def main():
return 1 return 1
u.success('System is NTP synchronized.') u.success('System is NTP synchronized.')
os.chdir(os.path.dirname(__file__))
u.log('Checking NTP server conforms to conf...') u.log('Checking NTP server conforms to conf...')
if not os.path.isfile('../utils.py'):
u.error('Could not find envsetup conf file or not running from expected location.')
return 1
conf = u.load_conf() conf = u.load_conf()
expected_servers = None expected_servers = None
if conf.get('NTP_SERVER'): if conf.get('NTP_SERVER'):
expected_servers = [s.strip() for s in conf['NTP_SERVER'].split(',')] expected_servers = [s.strip() for s in conf['NTP_SERVER'].split(',')]
...@@ -54,7 +47,6 @@ def main(): ...@@ -54,7 +47,6 @@ def main():
expected_servers = ['ntp.ubuntu.com'] expected_servers = ['ntp.ubuntu.com']
else: else:
expected_servers = ['0.debian.pool.ntp.org'] expected_servers = ['0.debian.pool.ntp.org']
with open(ntpconf, 'r') as fo: with open(ntpconf, 'r') as fo:
content = fo.read() content = fo.read()
servers = list() servers = list()
...@@ -69,6 +61,7 @@ def main(): ...@@ -69,6 +61,7 @@ def main():
else: else:
u.log('Expected NTP server %s found in configuration (total servers: %s).' % (expected_server, len(servers))) u.log('Expected NTP server %s found in configuration (total servers: %s).' % (expected_server, len(servers)))
u.success('NTP OK.') u.success('NTP OK.')
return 0 return 0
......
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