ntp: clones the server list from manifest

This commit is contained in:
Tiago Ilieve 2014-03-29 11:45:08 -03:00
parent afffdf680d
commit 16f37ceca8

View file

@ -23,7 +23,7 @@ class SetNtpServers(Task):
import os import os
import re import re
ntp_path = os.path.join(info.root, 'etc/ntp.conf') ntp_path = os.path.join(info.root, 'etc/ntp.conf')
servers = info.manifest.plugins['ntp']['servers'] servers = list(info.manifest.plugins['ntp']['servers'])
debian_ntp_server = re.compile('.*[0-9]\.debian\.pool\.ntp\.org.*') debian_ntp_server = re.compile('.*[0-9]\.debian\.pool\.ntp\.org.*')
for line in fileinput.input(files=ntp_path, inplace=True): for line in fileinput.input(files=ntp_path, inplace=True):
# Will write all the specified servers on the first match, then supress all other default servers # Will write all the specified servers on the first match, then supress all other default servers