Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installer: Stop adding distro-specific NTP servers into ntp.conf #279

Closed
wants to merge 1 commit into from
Closed

installer: Stop adding distro-specific NTP servers into ntp.conf #279

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 28, 2016

Distribution packaged ntpd has servers preconfigured in ntp.conf so
there's no point in trying to add them again during FreeIPA server
installation.

https://fedorahosted.org/freeipa/ticket/6486

@pspacek
Copy link
Contributor

pspacek commented Nov 28, 2016

NACK

Pylint is running, please wait ...
************* Module ipaserver.install.ntpinstance
ipaserver/install/ntpinstance.py:23: [W0611(unused-import), ] Unused ipautil imported from ipapython)
make: *** [pylint] Error 4
Makefile:1111: recipe for target 'pylint' failed

@pspacek
Copy link
Contributor

pspacek commented Nov 28, 2016

Have you tested the code? I would bet that it will remove everything except 127.127... from the list of servers.

srv_vals.append("0.%s.pool.ntp.org" % os)
srv_vals.append("1.%s.pool.ntp.org" % os)
srv_vals.append("2.%s.pool.ntp.org" % os)
srv_vals.append("3.%s.pool.ntp.org" % os)
srv_vals.append("127.127.1.0")
fudge = ["fudge", "127.127.1.0", "stratum", "10"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace the list with single value. It will simplify the code significantly (see below).

@@ -96,9 +82,6 @@ def __write_config(self):
break
if match:
srv_vals.remove(srv)
else:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The list logic is now completely unncecessary. Please remove it and replace with a single boolean indicating if 127.127.1.0 was found or not.

else:
file_changed = True
line = ""
if opt[0] == "server" and opt[1] == local_srv:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will blow up if a config line contains only single token. This an easily happen if your config contains some comments, e.g.

#####################################
# BEWARE: Do not touch this config! #
#####################################

@pspacek
Copy link
Contributor

pspacek commented Dec 6, 2016

NACK

Distribution packaged ntpd has servers preconfigured in ntp.conf so
there's no point in trying to add them again during FreeIPA server
installation.
Also fix the code to always put fudge line right after the local server
line as required by ntpd.

https://fedorahosted.org/freeipa/ticket/6486
@pspacek
Copy link
Contributor

pspacek commented Dec 19, 2016

ACK

@stlaz stlaz added the ack Pull Request approved, can be merged label Dec 19, 2016
@ghost ghost added the pushed Pull Request has already been pushed label Jan 5, 2017
@ghost
Copy link
Author

ghost commented Jan 5, 2017

@ghost ghost closed this Jan 5, 2017
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ack Pull Request approved, can be merged pushed Pull Request has already been pushed
Projects
None yet
2 participants