summaryrefslogtreecommitdiffstats
path: root/ipa-client/ipa-install/ipa-client-install
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2015-04-14 18:56:47 +0200
committerPetr Vobornik <pvoborni@redhat.com>2015-04-24 15:36:07 +0200
commite395bdb911ebf69fbf6b3e1c9e0e148a9600bd90 (patch)
treed3c3e880eb5e0d179d605e3754e7baa7f71cb790 /ipa-client/ipa-install/ipa-client-install
parent9bd181b33d263d8edf7a900fc925779e0c4fadda (diff)
downloadfreeipa-e395bdb911ebf69fbf6b3e1c9e0e148a9600bd90.tar.gz
freeipa-e395bdb911ebf69fbf6b3e1c9e0e148a9600bd90.tar.xz
freeipa-e395bdb911ebf69fbf6b3e1c9e0e148a9600bd90.zip
ipa client: make --ntp-server option multivalued
There can be more ntp servers in ntp.conf Required for ticket: https://fedorahosted.org/freeipa/ticket/4981 Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
Diffstat (limited to 'ipa-client/ipa-install/ipa-client-install')
-rwxr-xr-xipa-client/ipa-install/ipa-client-install19
1 files changed, 11 insertions, 8 deletions
diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install
index 47f1c128c..b3444cf9b 100755
--- a/ipa-client/ipa-install/ipa-client-install
+++ b/ipa-client/ipa-install/ipa-client-install
@@ -127,7 +127,9 @@ def parse_options():
basic_group.add_option("", "--force-join", dest="force_join",
action="store_true", default=False,
help="Force client enrollment even if already enrolled")
- basic_group.add_option("--ntp-server", dest="ntp_server", help="ntp server to use")
+ basic_group.add_option("--ntp-server", dest="ntp_servers", action="append",
+ help="ntp server to use. This option can be used "
+ "multiple times")
basic_group.add_option("-N", "--no-ntp", action="store_false",
help="do not configure ntp", default=True, dest="conf_ntp")
basic_group.add_option("", "--force-ntpd", dest="force_ntpd",
@@ -2344,10 +2346,11 @@ def install(options, env, fstore, statestore):
# We assume that NTP servers are discoverable through SRV records in the DNS
# If that fails, we try to sync directly with IPA server, assuming it runs NTP
root_logger.info('Synchronizing time with KDC...')
- ntp_servers = ds.ipadns_search_srv(cli_domain, '_ntp._udp', None, break_on_first=False)
+ ntp_srv_servers = ds.ipadns_search_srv(cli_domain, '_ntp._udp',
+ None, break_on_first=False)
synced_ntp = False
- if ntp_servers:
- for s in ntp_servers:
+ if ntp_srv_servers:
+ for s in ntp_srv_servers:
synced_ntp = ipaclient.ntpconf.synconce_ntp(s)
if synced_ntp:
break
@@ -2849,11 +2852,11 @@ def install(options, env, fstore, statestore):
# disable other time&date services first
if options.force_ntpd:
ipaclient.ntpconf.force_ntpd(statestore)
- if options.ntp_server:
- ntp_server = options.ntp_server
+ if options.ntp_servers:
+ ntp_servers = options.ntp_servers
else:
- ntp_server = cli_server[0]
- ipaclient.ntpconf.config_ntp(ntp_server, fstore, statestore)
+ ntp_servers = cli_server
+ ipaclient.ntpconf.config_ntp(ntp_servers, fstore, statestore)
root_logger.info("NTP enabled")
if options.conf_ssh: