Author: mvidner
Date: Wed Apr 30 14:17:01 2008
New Revision: 47224
URL: http://svn.opensuse.org/viewcvs/yast?rev=47224&view=rev
Log:
/etc/sysconfig/ntp:NTPD_INITIAL_NTPDATE was removed and assumes AUTO
now. Removed the UI related to it, but keet CLI and AutoYaST options
for compatibility (bnc#381838).
Modified:
trunk/ntp-client/package/yast2-ntp-client.changes
trunk/ntp-client/src/NtpClient.ycp
trunk/ntp-client/src/commandline.ycp
trunk/ntp-client/src/helps.ycp
trunk/ntp-client/src/ntpclient.rnc
trunk/ntp-client/src/widgets.ycp
trunk/ntp-client/testsuite/tests/Read.out
trunk/ntp-client/testsuite/tests/Read.ycp
trunk/ntp-client/testsuite/tests/Write.out
trunk/ntp-client/testsuite/tests/Write.ycp
Modified: trunk/ntp-client/package/yast2-ntp-client.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/package/yast2-ntp-client.changes?rev=47224&r1=47223&r2=47224&view=diff
==============================================================================
--- trunk/ntp-client/package/yast2-ntp-client.changes (original)
+++ trunk/ntp-client/package/yast2-ntp-client.changes Wed Apr 30 14:17:01 2008
@@ -1,6 +1,9 @@
-------------------------------------------------------------------
-Wed Apr 30 11:10:27 CEST 2008 - mvidner@suse.cz
+Wed Apr 30 14:16:39 CEST 2008 - mvidner@suse.cz
+- /etc/sysconfig/ntp:NTPD_INITIAL_NTPDATE was removed and assumes AUTO
+ now. Removed the UI related to it, but keet CLI and AutoYaST options
+ for compatibility (bnc#381838).
- Avoid "UI syntax error" when Write is called from the timezone
module (bnc#384715).
Modified: trunk/ntp-client/src/NtpClient.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/src/NtpClient.ycp?rev=47224&r1=47223&r2=47224&view=diff
==============================================================================
--- trunk/ntp-client/src/NtpClient.ycp (original)
+++ trunk/ntp-client/src/NtpClient.ycp Wed Apr 30 14:17:01 2008
@@ -474,48 +474,13 @@
failed = true;
ProcessNtpConf();
- run_chroot = SCR::Read (.sysconfig.ntp.NTPD_RUN_CHROOTED) == "yes";
+ string run_chroot_s = (string) SCR::Read (.sysconfig.ntp.NTPD_RUN_CHROOTED);
+ run_chroot = run_chroot_s == "yes";
- string initial_sync = (string)SCR::Read (.sysconfig.ntp.NTPD_INITIAL_NTPDATE);
- if (initial_sync == nil)
+ if (run_chroot_s == nil)
{
- initial_sync = "";
failed = true;
- y2error ("Failed reading .sysconfig.ntp.NTPD_INITIAL_NTPDATE");
- }
-
- // mark those servers and peers that are used for initial syncing
- if (initial_sync == "AUTO")
- {
- ntp_records = maplist (map p, ntp_records, ``{
- p["initial_sync"] = p["type"]:"" == "server";
- return p;
- });
- }
- else if (regexpmatch (initial_sync, "AUTO-[0-9]+"))
- {
- integer count = tointeger (
- regexpsub (initial_sync, "AUTO-([0-9]+)", "\\1"));
- ntp_records = maplist (map p, ntp_records, ``{
- if (p["type"]:"" == "server" || p["type"]:"" == "peer")
- {
- count = count - 1;
- p["initial_sync"] = count >= 0;
- }
- else
- p["initial_sync"] = false;
- return p;
- });
- }
- else
- {
- list listed = splitstring (initial_sync, " ");
- ntp_records = maplist (map p, ntp_records, ``{
- p["initial_sync"]
- = (p["type"]:"" == "server" || p["type"]:"" == "peer")
- && contains (listed, p["address"]:"");
- return p;
- });
+ y2error ("Failed reading .sysconfig.ntp.NTPD_RUN_CHROOTED");
}
if(failed)
@@ -621,7 +586,6 @@
string one_address = one_record["address"]:"";
store_current_options[one_address] = $[];
store_current_options[one_address, "options"] = one_record["options"]:"";
- store_current_options[one_address, "initial_sync"] = one_record["initial_sync"]:true;
}
});
@@ -636,20 +600,17 @@
});
foreach (string one_server, random_pool_servers, {
- boolean one_initial_sync = true;
string one_options = "";
if (haskey(store_current_options, one_server)) {
- one_initial_sync = store_current_options[one_server, "initial_sync"]:true;
one_options = store_current_options[one_server, "options"]:"";
- y2milestone("Leaving current configuration for server '%1', initial_sync: '%2', options '%3'",
- one_server, one_initial_sync, one_options);
+ y2milestone("Leaving current configuration for server '%1', options '%2'",
+ one_server, one_options);
}
ntp_records = add (ntp_records, $[
"address":one_server,
"comment":"\n# Random pool server, see http://www.pool.ntp.org/ for more information\n",
- "initial_sync":one_initial_sync,
"options":one_options,
"type":"server"
]);
@@ -785,32 +746,10 @@
Service::RunInitScript ("network", "restart-all-dhcp-clients");
}
- list init = maplist (map p, ntp_records, ``(
- (p["type"]:"" == "server" || p["type"]:"" == "peer")
- && p["initial_sync"]:false
- ? p["address"]:""
- : nil
- ));
- init = filter (any i, init, ``(i != nil));
- string init_str = mergestring ((list<string>)init, " ");
-
- // if DHCLIENT_MODIFY_NTP_CONF, NTPD_INITIAL = AUTO
- if (config_dhcp) {
- init_str = "AUTO";
- // Don't remove the AUTO key, something should be present for initialization
- // if there is no NTP server set explicitly
- } else if (size (init) == 0) {
- string orig_init = (string)SCR::Read (.sysconfig.ntp.NTPD_INITIAL_NTPDATE);
- if (orig_init == "AUTO" || substring (orig_init, 0, 5) == "AUTO-") {
- init_str = orig_init;
- }
- }
-
if (! (SCR::Write (.sysconfig.ntp.NTPD_RUN_CHROOTED, run_chroot
? "yes"
: "no")
- && SCR::Write (.sysconfig.ntp.NTPD_INITIAL_NTPDATE, init_str)
- && SCR::Write (.sysconfig.ntp, nil)))
+ && SCR::Write (.sysconfig.ntp, nil)))
{
// error report
Report::Error (_("Cannot write sysconfig variables."));
@@ -877,8 +816,6 @@
{
p["type"] = p["key"]:"";
p["address"] = p["value"]:"";
- if (haskey (p, "initial"))
- p["initial_sync"] = p["initial"]:false;
if (haskey (p, "param"))
p["options"] = p["param"]:"";
return (p);
Modified: trunk/ntp-client/src/commandline.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/src/commandline.ycp?rev=47224&r1=47223&r2=47224&view=diff
==============================================================================
--- trunk/ntp-client/src/commandline.ycp (original)
+++ trunk/ntp-client/src/commandline.ycp Wed Apr 30 14:17:01 2008
@@ -77,9 +77,9 @@
if (haskey (options, "fudge"))
NtpClient::selected_record["fudge_options"] = options["fudge"]:"";
if (haskey (options, "initial"))
- NtpClient::selected_record["initial_sync"] = true;
+ y2warning ("option 'initial' is obsolete");
if (haskey (options, "no-initial"))
- NtpClient::selected_record["initial_sync"] = false;
+ y2warning ("option 'no-initial' is obsolete");
return NtpClient::storeSyncRecord ();
}
@@ -283,14 +283,6 @@
"help" : _("Options for clock driver calibration"),
"type" : "string",
],
- "initial" : $[
- // command line help text for an option
- "help" : _("Use the server for initial synchronization"),
- ],
- "no-initial" : $[
- // command line help text for an option
- "help" : _("Do not use the server for initial synchronization"),
- ],
],
"mappings" : $[
Modified: trunk/ntp-client/src/helps.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/src/helps.ycp?rev=47224&r1=47223&r2=47224&view=diff
==============================================================================
--- trunk/ntp-client/src/helps.ycp (original)
+++ trunk/ntp-client/src/helps.ycp Wed Apr 30 14:17:01 2008
@@ -130,11 +130,7 @@
To set the address from which to accept broadcast packets, use
<b>Address</b>.</p>"),
- // help text 2/4, optinal
- "init_sync" : _("<p><b><big>Initial Synchronization</big></b><br>
-The first synchronization of the clock is performed before the NTP daemon is
-started. To use this host for initial synchronization, select
-<b>Use for Initial Synchronization</b>.</p>"),
+ // help text 2/4, was removed
// help text 3/4, optional
"options" : _("<p><b><big>Options</big></b><br>
Modified: trunk/ntp-client/src/ntpclient.rnc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/src/ntpclient.rnc?rev=47224&r1=47223&r2=47224&view=diff
==============================================================================
--- trunk/ntp-client/src/ntpclient.rnc (original)
+++ trunk/ntp-client/src/ntpclient.rnc Wed Apr 30 14:17:01 2008
@@ -10,6 +10,7 @@
element create_symlink { BOOLEAN }
configure_dhcp =
element configure_dhcp { BOOLEAN }
+# ignored since 2.16.8
initial_sync =
element initial_sync { BOOLEAN }
fudge_comment = element fudge_comment { text }
Modified: trunk/ntp-client/src/widgets.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/src/widgets.ycp?rev=47224&r1=47223&r2=47224&view=diff
==============================================================================
--- trunk/ntp-client/src/widgets.ycp (original)
+++ trunk/ntp-client/src/widgets.ycp Wed Apr 30 14:17:01 2008
@@ -231,7 +231,6 @@
y2milestone("The currently selected server is the same as when starting the module...");
} else {
NtpClient::selected_record["type"] = "server";
- NtpClient::selected_record["initial_sync"] = true;
y2milestone("Storing the current address record: %1", NtpClient::selected_record);
NtpClient::storeSyncRecord();
}
@@ -575,7 +574,6 @@
{
y2milestone("Storing the server address in simple configuration");
NtpClient::selected_record["type"] = "server";
- NtpClient::selected_record["initial_sync"] = true;
}
}
}
@@ -651,26 +649,6 @@
* Initialize the widget
* @param id any widget id
*/
-define void initSyncInit (string id) ``{
- y2milestone("Selected %1", NtpClient::selected_record);
- UI::ChangeWidget (`id ("init_sync"), `Value,
- NtpClient::selected_record["initial_sync"]:false);
-}
-
-/**
- * Store settings of the widget
- * @param id any widget id
- * @param event map event that caused storing process
- */
-define void initSyncStore (string id, map event) ``{
- NtpClient::selected_record["initial_sync"]
- = UI::QueryWidget (`id ("init_sync"), `Value);
-}
-
-/**
- * Initialize the widget
- * @param id any widget id
- */
define void optionsInit (string id) ``{
UI::ChangeWidget (`id ("options"), `Value, NtpClient::selected_record["options"]:"");
}
@@ -1367,14 +1345,6 @@
"handle" : browseButtonHandle,
"help" : " ",
],
- "init_sync" : $[
- "widget" : `checkbox,
- // checkbox
- "label" : _("Use for &Initial Synchronization"),
- "init" : initSyncInit,
- "store" : initSyncStore,
- "help" : HELPS["init_sync"]:"",
- ],
"options" : $[
"widget" : `textentry,
// text entry label
Modified: trunk/ntp-client/testsuite/tests/Read.out
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/testsuite/tests/Read.out?rev=47224&r1=47223&r2=47224&view=diff
==============================================================================
--- trunk/ntp-client/testsuite/tests/Read.out (original)
+++ trunk/ntp-client/testsuite/tests/Read.out Wed Apr 30 14:17:01 2008
@@ -7,6 +7,5 @@
Read .target.ycp "/var/lib/YaST2/ad_ntp_data.ycp" nil
Read .etc.ntp_conf.all $["comment":"", "file":-1, "kind":"section", "name":"", "type":-1, "value":[$["comment":"", "kind":"value", "name":"server", "type":0, "value":"ntp1 options1"], $["comment":"", "kind":"value", "name":"server", "type":0, "value":"127.127.1.2 options_clock"], $["comment":"", "kind":"value", "name":"fudge", "type":0, "value":"127.127.1.2fudge_clock"], $["comment":"", "kind":"value", "name":"server", "type":0, "value":"ntp2 options2"], $["comment":"", "kind":"value", "name":"peer", "type":0, "value":"peer1 options_peer"]]]
Read .sysconfig.ntp.NTPD_RUN_CHROOTED "yes"
-Read .sysconfig.ntp.NTPD_INITIAL_NTPDATE "AUTO-2"
Return true
-Return $["configure_dhcp":false, "peers":[$["address":"ntp1", "comment":"", "initial_sync":true, "options":" options1", "type":"server"], $["address":"127.127.1.2", "comment":"", "initial_sync":false, "options":" options_clock", "type":"__clock"], $["address":"ntp2", "comment":"", "initial_sync":true, "options":" options2", "type":"server"], $["address":"peer1", "comment":"", "initial_sync":false, "options":" options_peer", "type":"peer"]], "start_at_boot":false, "start_in_chroot":true]
+Return $["configure_dhcp":false, "peers":[$["address":"ntp1", "comment":"", "options":" options1", "type":"server"], $["address":"127.127.1.2", "comment":"", "options":" options_clock", "type":"__clock"], $["address":"ntp2", "comment":"", "options":" options2", "type":"server"], $["address":"peer1", "comment":"", "options":" options_peer", "type":"peer"]], "start_at_boot":false, "start_in_chroot":true]
Modified: trunk/ntp-client/testsuite/tests/Read.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/testsuite/tests/Read.ycp?rev=47224&r1=47223&r2=47224&view=diff
==============================================================================
--- trunk/ntp-client/testsuite/tests/Read.ycp (original)
+++ trunk/ntp-client/testsuite/tests/Read.ycp Wed Apr 30 14:17:01 2008
@@ -78,7 +78,6 @@
],
"sysconfig" : $[
"ntp" : $[
- "NTPD_INITIAL_NTPDATE" : "AUTO-2",
"NTPD_RUN_CHROOTED" : "yes",
],
"personal-firewall" : $[
Modified: trunk/ntp-client/testsuite/tests/Write.out
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/testsuite/tests/Write.out?rev=47224&r1=47223&r2=47224&view=diff
==============================================================================
--- trunk/ntp-client/testsuite/tests/Write.out (original)
+++ trunk/ntp-client/testsuite/tests/Write.out Wed Apr 30 14:17:01 2008
@@ -6,6 +6,5 @@
Write .etc.ntp_conf.all $["comment":"", "file":-1, "kind":"section", "name":"", "type":-1, "value":[$["comment":"", "kind":"value", "name":"server", "type":0, "value":"ntp1 options1"], $["comment":"", "kind":"value", "name":"server", "type":0, "value":"127.127.1.2 options_clock"], $["comment":"", "kind":"value", "name":"fudge", "type":0, "value":"127.127.1.2 "], $["comment":"", "kind":"value", "name":"server", "type":0, "value":"ntp2 options2"], $["comment":"", "kind":"value", "name":"peer", "type":0, "value":"peer1 options_peer"]]] true
Write .etc.ntp_conf nil true
Write .sysconfig.ntp.NTPD_RUN_CHROOTED "yes" true
-Write .sysconfig.ntp.NTPD_INITIAL_NTPDATE "ntp1 ntp2" true
Write .sysconfig.ntp nil true
Return true
Modified: trunk/ntp-client/testsuite/tests/Write.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/testsuite/tests/Write.ycp?rev=47224&r1=47223&r2=47224&view=diff
==============================================================================
--- trunk/ntp-client/testsuite/tests/Write.ycp (original)
+++ trunk/ntp-client/testsuite/tests/Write.ycp Wed Apr 30 14:17:01 2008
@@ -41,7 +41,6 @@
],
"sysconfig" : $[
"ntp" : $[
- "NTPD_INITIAL_NTPDATE" : "AUTO-2",
"NTPD_RUN_CHROOTED" : "yes",
],
"personal-firewall" : $[
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org