Mailinglist Archive: yast-devel (233 mails)

< Previous Next >
[yast-devel] Re: [yast-commit] <web-client> master : - mistery why proxy_for works and load_proxy does not
  • From: josef reidinger <jreidinger@xxxxxxx>
  • Date: Wed, 28 Oct 2009 17:37:16 +0100
  • Message-id: <4AE8733C.3020302@xxxxxxx>
Duncan Mac-Vicar P napsal(a):
ref: refs/heads/master
commit 5f6dc2297cb13af2e8100bf937a15c67d6134351
Author: Duncan Mac-Vicar P <dmacvicar@xxxxxxx>
Date: Wed Oct 28 16:11:34 2009 +0100

- mistery why proxy_for works and load_proxy does not
- use URI.parse so we make sure it works even if the URI is a plain
string
---
.../status/app/controllers/status_controller.rb | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/plugins/status/app/controllers/status_controller.rb
b/plugins/status/app/controllers/status_controller.rb
index 5a44b12..3dea392 100644
--- a/plugins/status/app/controllers/status_controller.rb
+++ b/plugins/status/app/controllers/status_controller.rb
@@ -144,7 +144,7 @@ class StatusController < ApplicationController
end

lines = params[:lines] || 5
- log_url = YaST::ServiceResource::Session.site
+ log_url = URI.parse(YaST::ServiceResource::Session.site.to_s)
log_url = log_url.merge("logs/#{params[:id]}.txt?lines=#{lines}")
logger.info "requesting #{log_url}"
@content = open(log_url).read
@@ -154,8 +154,7 @@ class StatusController < ApplicationController
def index
return unless client_permissions

- #log = YaST::ServiceResource.proxy_for('org.opensuse.yast.system.logs')
- log = load_proxy 'org.opensuse.yast.system.logs'
+ log = YaST::ServiceResource.proxy_for('org.opensuse.yast.system.logs')
@logs = log.find(:all)


^^^
reason is simple load_proxy return instance of ActiveRecord not class.
So for you case working code is:
@logs = load_proxy 'org.opensuse.yast.system.logs', :all
(check documenatation for load_proxy ;)
Josef


create_data

--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages