ref: refs/heads/master
commit 6cb4c0b78ed6339457e800efea5766d85b9d5c8b
Author: Klaus Kämpf
Date: Mon Jul 13 16:37:10 2009 +0200
Cope with missing patches proxy
---
.../app/controllers/controlpanel_controller.rb | 10 ++++++++--
webclient/app/views/controlpanel/index.rhtml | 4 ++--
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/webclient/app/controllers/controlpanel_controller.rb b/webclient/app/controllers/controlpanel_controller.rb
index 16ab0c3..453b0b0 100644
--- a/webclient/app/controllers/controlpanel_controller.rb
+++ b/webclient/app/controllers/controlpanel_controller.rb
@@ -12,7 +12,8 @@ class ControlpanelController < ApplicationController
def index
@shortcuts = shortcuts_data
- check_update
+ res = check_update
+ @update_label, @update_image = res if res.is_a? Array
end
def show_all
@@ -42,7 +43,10 @@ class ControlpanelController < ApplicationController
# Check patches
def check_update
proxy = YaST::ServiceResource.proxy_for('org.opensuse.yast.system.patches')
- # FIXME: check proxy
+ unless proxy
+ logger.warn "Couldn't find proxy for org.opensuse.yast.system.patches"
+ return
+ end
begin
patch_updates = proxy.find(:all) || []
rescue ActiveResource::ClientError => e
@@ -51,6 +55,7 @@ class ControlpanelController < ApplicationController
rescue Exception => e
flash[:error] = "An exception was raised. Check the logs."
logger.error e
+ logger.info e.backtrace.join("\n")
return
end
@@ -82,6 +87,7 @@ class ControlpanelController < ApplicationController
img = "/images/button_ok.png"
end
logger.debug "evaluated patches #{patch_updates.inspect} ==> security:#{security}; important:#{important}; optional:#{optional}"
+ [ label, img ]
end
# reads the shortcuts and returns the
diff --git a/webclient/app/views/controlpanel/index.rhtml b/webclient/app/views/controlpanel/index.rhtml
index 7712f3f..b4fc631 100644
--- a/webclient/app/views/controlpanel/index.rhtml
+++ b/webclient/app/views/controlpanel/index.rhtml
@@ -2,10 +2,10 @@
<h3><img src="/images/monitoring.png" alt="" height="23" width="23" border="0"> <%= _("Status") %></h3>
<div id="status_patches_icon">
- alt="" height="32" width="32" border="0">
+ alt="" height="32" width="32" border="0">
</div>
<div id="status_patches_msg">
- <a href="patch_updates"><%=@label%></a>
+ <a href="patch_updates"><%=@update_label%></a>
</div>
<br>
<div id="status_health_icon">
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org