[yast-commit] <web-client> backgroud_patches_bnc550934 : Force UTC time in hardware clock (bnc#556467) release 0.0.12
ref: refs/heads/backgroud_patches_bnc550934 commit 6749e2091e5b724a5cdabbdf22ad4e364d147c50 Author: Josef Reidinger <jreidinger@suse.cz> Date: Fri Nov 20 12:14:59 2009 +0100 Force UTC time in hardware clock (bnc#556467) release 0.0.12 --- .../app/controllers/systemtime_controller.rb | 5 +-- .../systemtime/app/views/systemtime/index.rhtml | 10 --------- plugins/systemtime/lib/systemtime.rb | 8 +----- .../package/yast2-webclient-systemtime.changes | 6 +++++ .../package/yast2-webclient-systemtime.spec | 2 +- .../test/functional/systemtime_controller_test.rb | 22 ++++--------------- 6 files changed, 16 insertions(+), 37 deletions(-) diff --git a/plugins/systemtime/app/controllers/systemtime_controller.rb b/plugins/systemtime/app/controllers/systemtime_controller.rb index 2deecde..20275d1 100644 --- a/plugins/systemtime/app/controllers/systemtime_controller.rb +++ b/plugins/systemtime/app/controllers/systemtime_controller.rb @@ -91,13 +91,11 @@ class SystemtimeController < ApplicationController return false unless t fill_proxy_with_timezone t, params, t.timezones + clear_time t #do nothing case params[:timeconfig] - when "none" - clear_time t #do nothing when "manual" fill_proxy_with_time t,params when "ntp_sync" - clear_time t ntp = load_proxy 'org.opensuse.yast.modules.yapi.ntp' return false unless ntp ntp.synchronize = true @@ -107,6 +105,7 @@ class SystemtimeController < ApplicationController #do nothing as if you move time to future it throws this exception log.info "Time moved to future by NTP" end + when "none" else logger.error "Unknown value for timeconfig #{params[:timeconfig]}" end diff --git a/plugins/systemtime/app/views/systemtime/index.rhtml b/plugins/systemtime/app/views/systemtime/index.rhtml index 6a0ec37..a13dbbb 100644 --- a/plugins/systemtime/app/views/systemtime/index.rhtml +++ b/plugins/systemtime/app/views/systemtime/index.rhtml @@ -64,16 +64,6 @@ :disabled => disabled}) %> </span> </p> - <p> - <% if @utcstatus != "UTConly" %> - <label for="utc"><%= _("Hardware clock is set to <br>UTC") %></label> - <% #don't use check_box helper as it generate also hidden opposite value - %> - <input type="checkbox" name="utc" id="utc" value="true" - <%= "checked=\"checked\"" if @utcstatus == "UTC"%> - <%= "disabled=\"disabled\"" if disabled %> /> - <% end %> - </p> </fieldset> <fieldset> <p> diff --git a/plugins/systemtime/lib/systemtime.rb b/plugins/systemtime/lib/systemtime.rb index e8a6bf3..94b3191 100644 --- a/plugins/systemtime/lib/systemtime.rb +++ b/plugins/systemtime/lib/systemtime.rb @@ -10,12 +10,8 @@ end def fill_proxy_with_timezone(proxy,params,timezones) region = timezones.find { |reg| reg.name == params[:region] } || Hash.new - tmz = region.entries.find { |e| e.name == params[:timezone]} proxy.timezone = tmz.id if tmz - - if (proxy.utcstatus != "UTConly") - proxy.utcstatus = params[:utc] == "true" ? "UTC" : "localtime" - end -end \ No newline at end of file + proxy.utcstatus = "UTC" #allways UTC see bnc#556467 +end diff --git a/plugins/systemtime/package/yast2-webclient-systemtime.changes b/plugins/systemtime/package/yast2-webclient-systemtime.changes index 8205bff..2d06ac9 100644 --- a/plugins/systemtime/package/yast2-webclient-systemtime.changes +++ b/plugins/systemtime/package/yast2-webclient-systemtime.changes @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Nov 20 10:27:20 UTC 2009 - jreidinger@novell.com + +- always set hardware clock to UTC (bnc#556467) +- 0.0.12 + +------------------------------------------------------------------- Wed Nov 18 09:35:51 UTC 2009 - jreidinger@novell.com - catch timeout exception if ntp move time to future or past diff --git a/plugins/systemtime/package/yast2-webclient-systemtime.spec b/plugins/systemtime/package/yast2-webclient-systemtime.spec index 6977a8c..e3f3c26 100644 --- a/plugins/systemtime/package/yast2-webclient-systemtime.spec +++ b/plugins/systemtime/package/yast2-webclient-systemtime.spec @@ -14,7 +14,7 @@ PreReq: yast2-webclient >= 0.0.2 License: GPL v2 only Group: Productivity/Networking/Web/Utilities Autoreqprov: on -Version: 0.0.11 +Version: 0.0.12 Release: 0 Summary: YaST2 - Webclient - SystemTime Source: www.tar.bz2 diff --git a/plugins/systemtime/test/functional/systemtime_controller_test.rb b/plugins/systemtime/test/functional/systemtime_controller_test.rb index 092f51b..815daa0 100644 --- a/plugins/systemtime/test/functional/systemtime_controller_test.rb +++ b/plugins/systemtime/test/functional/systemtime_controller_test.rb @@ -40,7 +40,7 @@ class SystemtimeControllerTest < ActionController::TestCase ] @time = "12:18:00" @date = "07/02/2009" - @utcstatus = "true" + @utcstatus = "UTC" @timezone = "Europe/Prague" end @@ -75,7 +75,6 @@ class SystemtimeControllerTest < ActionController::TestCase assert assigns(:time) assert assigns(:date) assert_equal assigns(:timezone), "Europe/Prague" - assert assigns(:utcstatus) end def test_access_without_write_permissions @@ -95,37 +94,26 @@ class SystemtimeControllerTest < ActionController::TestCase def test_commit YaST::ServiceResource.stubs(:proxy_for).with('org.opensuse.yast.modules.yapi.time').returns(@proxy) - post :update, { :currenttime => "2009-07-02 - 12:18:00", :date => { :date => "2009-07-02 - 12:18:00/2009-07-02 - 12:18:00" }, :utc => "true" } + post :update, { :currenttime => "2009-07-02 - 12:18:00", :date => { :date => "2009-07-02 - 12:18:00/2009-07-02 - 12:18:00" } } assert_response :redirect assert_redirected_to :action => "index" assert @result.saved + assert_equal @result.utcstatus, "UTC" end - #Handling permissions is not done automatic and this test should not be here -# def test_failing_permissions -# YaST::ServiceResource.stubs(:proxy_for).with('org.opensuse.yast.modules.yapi.time').returns(@proxy) -# def @proxy.permissions -# raise "Cannot find permission" -# end -# -# get :index -# -# assert_response :redirect -# assert_redirected_to "/bad_permissions" -# end - def test_commit_wizard YaST::ServiceResource.stubs(:proxy_for).with('org.opensuse.yast.modules.yapi.time').returns(@proxy) session[:wizard_current] = "test" session[:wizard_steps] = "systemtime,language" - post :update, { :currenttime => "2009-07-02 - 12:18:00", :date => { :date => "2009-07-02 - 12:18:00/2009-07-02 - 12:18:00" }, :utc => "true" } + post :update, { :currenttime => "2009-07-02 - 12:18:00", :date => { :date => "2009-07-02 - 12:18:00/2009-07-02 - 12:18:00" }} puts @response.body assert_response :redirect assert_redirected_to :controller => "controlpanel", :action => "nextstep" assert @result.saved + assert_equal @result.utcstatus, "UTC" end end -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
Josef Reidinger