ref: refs/heads/master
commit 0f69613a8353f8af1492bae124574aadf3866737
Author: Josef Reidinger
Date: Tue Jul 14 14:57:40 2009 +0200
Enhance proxy loader that take arguments for find call, patches use proxy loader, more robust to missing proxy in patches
---
webclient/lib/proxy_loader.rb | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/webclient/lib/proxy_loader.rb b/webclient/lib/proxy_loader.rb
index d3ec01e..32934e3 100644
--- a/webclient/lib/proxy_loader.rb
+++ b/webclient/lib/proxy_loader.rb
@@ -19,8 +19,9 @@ module ProxyLoader
#Finds proxy and find its result.
#_fields_:: set @+permissions+ field to permissions of proxy
#name:: Name of proxy
+ #find_ard:: Argument for find call on proxy, nil is no argument (singleton resource)
#+returns+:: Returns result of proxy.find or nil if something goes bad
- def load_proxy (name)
+ def load_proxy (name,find_arg = nil)
proxy = YaST::ServiceResource.proxy_for(name)
unless proxy
@@ -34,7 +35,11 @@ module ProxyLoader
ret = nil
begin
- ret = proxy.find
+ if find_arg
+ ret = proxy.find find_arg
+ else
+ ret = proxy.find
+ end
rescue ActiveResource::ClientError => e
flash[:error] = YaST::ServiceResource.error(e)
ExceptionLogger.log_exception e
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org