Run ntpdate in verbose mode, not debug (i.e. no-op) mode

Remove the debug argument to synconce_ntp since we always want the logs
to be verbose.

https://fedorahosted.org/freeipa/ticket/3048
This commit is contained in:
Petr Viktorin 2012-09-04 05:15:31 -04:00 committed by Martin Kosek
parent ed44de17ff
commit 5bcbe1df37
2 changed files with 6 additions and 8 deletions

View File

@ -1421,11 +1421,11 @@ def install(options, env, fstore, statestore):
synced_ntp = False synced_ntp = False
if ntp_servers: if ntp_servers:
for s in ntp_servers: for s in ntp_servers:
synced_ntp = ipaclient.ntpconf.synconce_ntp(s, debug=True) synced_ntp = ipaclient.ntpconf.synconce_ntp(s)
if synced_ntp: if synced_ntp:
break break
if not synced_ntp: if not synced_ntp:
synced_ntp = ipaclient.ntpconf.synconce_ntp(cli_server[0], debug=True) synced_ntp = ipaclient.ntpconf.synconce_ntp(cli_server[0])
if not synced_ntp: if not synced_ntp:
root_logger.warning("Unable to sync time with IPA NTP " + root_logger.warning("Unable to sync time with IPA NTP " +
"server, assuming the time is in sync.") "server, assuming the time is in sync.")

View File

@ -133,7 +133,8 @@ def config_ntp(server_fqdn, fstore = None, sysstore = None):
# Restart ntpd # Restart ntpd
ipaservices.knownservices.ntpd.restart() ipaservices.knownservices.ntpd.restart()
def synconce_ntp(server_fqdn, debug=False):
def synconce_ntp(server_fqdn):
""" """
Syncs time with specified server using ntpdate. Syncs time with specified server using ntpdate.
Primarily designed to be used before Kerberos setup Primarily designed to be used before Kerberos setup
@ -145,11 +146,8 @@ def synconce_ntp(server_fqdn, debug=False):
if os.path.exists(ntpdate): if os.path.exists(ntpdate):
# retry several times -- logic follows /etc/init.d/ntpdate # retry several times -- logic follows /etc/init.d/ntpdate
# implementation # implementation
cmd = [ntpdate, "-U", "ntp", "-s", "-b"] cmd = [ntpdate, "-U", "ntp", "-s", "-b", "-v", server_fqdn]
if debug: for retry in range(0, 3):
cmd.append('-d')
cmd.append(server_fqdn)
for retry in range(0,3):
try: try:
ipautil.run(cmd) ipautil.run(cmd)
return True return True