diff --git a/src/lib/cfa/chrony_conf.rb b/src/lib/cfa/chrony_conf.rb index 16a995dc..498bb719 100644 --- a/src/lib/cfa/chrony_conf.rb +++ b/src/lib/cfa/chrony_conf.rb @@ -127,7 +127,7 @@ def pure_pools def pool_matcher(address) Matcher.new do |k, v| k == "pool[]" && - (v.respond_to?(:value) ? v.value == address : v == address) + (v.respond_to?(:value) ? v.value == address : v == address) end end end diff --git a/src/lib/y2ntp_client/dialog/main.rb b/src/lib/y2ntp_client/dialog/main.rb index 2a476510..2de42d43 100644 --- a/src/lib/y2ntp_client/dialog/main.rb +++ b/src/lib/y2ntp_client/dialog/main.rb @@ -9,6 +9,7 @@ module Y2NtpClient module Dialog + # Main entry point for Ntp Client class Main < CWM::Dialog def initialize textdomain "ntp-client" @@ -63,10 +64,10 @@ def hardware_clock_widgets if Yast::NtpClient.ntp_conf.hardware_clock? [ Label(_("Hardware clock configured as source. YaST will keep it untouched.")), - VSpacing(1), + VSpacing(1) ] else - [ Empty() ] + [Empty()] end end diff --git a/src/lib/y2ntp_client/dialog/pool.rb b/src/lib/y2ntp_client/dialog/pool.rb index 7ab35460..8baf7bba 100644 --- a/src/lib/y2ntp_client/dialog/pool.rb +++ b/src/lib/y2ntp_client/dialog/pool.rb @@ -9,6 +9,7 @@ module Y2NtpClient module Dialog + # Dialog to add/edit ntp pool server class Pool < CWM::Dialog # @param pool_entry [nil, Hash] def initialize(address = "", options = {}) @@ -34,7 +35,7 @@ def contents HBox( Widgets::Iburst.new(@options), HSpacing(), - Widgets::Offline.new(@options), + Widgets::Offline.new(@options) ) ) end diff --git a/src/lib/y2ntp_client/widgets/main_widgets.rb b/src/lib/y2ntp_client/widgets/main_widgets.rb index ba4f8844..f9da2bbb 100644 --- a/src/lib/y2ntp_client/widgets/main_widgets.rb +++ b/src/lib/y2ntp_client/widgets/main_widgets.rb @@ -11,6 +11,7 @@ module Y2NtpClient module Widgets + # Widget for netconfig policy class PolicyCombo < CWM::ComboBox def initialize textdomain "ntp-client" @@ -50,14 +51,15 @@ def init end def store - if value != Yast::NtpClient.ntp_policy - log.info "ntp policy modifed to #{value.inspect}" - Yast::NtpClient.modified = true - Yast::NtpClient.ntp_policy = value - end + return if value == Yast::NtpClient.ntp_policy + + log.info "ntp policy modifed to #{value.inspect}" + Yast::NtpClient.modified = true + Yast::NtpClient.ntp_policy = value end end + # Widget to configure how ntp will be started class NtpStart < CWM::RadioButtons def initialize(replace_point) textdomain "ntp-client" @@ -108,6 +110,7 @@ def store end end + # Widget representing how often synchronize via cron class SyncInterval < CWM::IntField def initialize textdomain "ntp-client" @@ -130,6 +133,7 @@ def store end end + # Table with ntp pool servers class ServersTable < CWM::Table def initialize textdomain "ntp-client" @@ -170,6 +174,7 @@ def items end end + # Button to add ntp pool server class AddPoolButton < CWM::PushButton def initialize textdomain "ntp-client" @@ -194,6 +199,7 @@ def handle end end + # Button to edit ntp pool server class EditPoolButton < CWM::PushButton def initialize(table) textdomain "ntp-client" @@ -216,6 +222,7 @@ def handle end end + # Button to delete ntp pool server class DeletePoolButton < CWM::PushButton def initialize(table) textdomain "ntp-client" diff --git a/src/lib/y2ntp_client/widgets/pool_widgets.rb b/src/lib/y2ntp_client/widgets/pool_widgets.rb index ba8adc42..6b6a2070 100644 --- a/src/lib/y2ntp_client/widgets/pool_widgets.rb +++ b/src/lib/y2ntp_client/widgets/pool_widgets.rb @@ -6,6 +6,7 @@ module Y2NtpClient module Widgets + # Input field with address class PoolAddress < CWM::InputField attr_reader :address @@ -32,6 +33,7 @@ def store end end + # Button that tests if server is reachable class TestButton < CWM::PushButton def initialize(address_widget) textdomain "ntp-client" @@ -49,6 +51,7 @@ def handle end end + # Enable iburst option class Iburst < CWM::CheckBox def initialize(options) textdomain "ntp-client" @@ -78,6 +81,7 @@ def help end end + # Enable offline option class Offline < CWM::CheckBox def initialize(options) textdomain "ntp-client" @@ -101,9 +105,9 @@ def store end def help - _("Start Offline specifies if option offline is used. This option skip this server " \ - "during start. It is useful for machine which start without network, because it speed up " \ - " boot and sync when machine is connected to network.") + _("Start Offline specifies if option offline is used. This option skip this " \ + "server during start. It is useful for machine which start without network, because " \ + "it speed up boot and sync when machine is connected to network.") end end end diff --git a/src/modules/NtpClient.rb b/src/modules/NtpClient.rb index 5329a96a..fce936ff 100644 --- a/src/modules/NtpClient.rb +++ b/src/modules/NtpClient.rb @@ -476,6 +476,7 @@ def Write # @param [Hash] settings The YCP structure to be imported. # @return [Boolean] True on success def Import(settings) + log.info "Import with #{settings}" # TODO: implement for chrony @modified = true true