From b9249a71bc4fd6323f2ec879018f497027a4545a Mon Sep 17 00:00:00 2001 From: rautenberg Date: Thu, 22 Mar 2012 12:21:31 +0100 Subject: retry opensso if connection fails (1x) log error if fails twice --- lib/authorization.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/authorization.rb b/lib/authorization.rb index 4d54c41..470ecd8 100644 --- a/lib/authorization.rb +++ b/lib/authorization.rb @@ -5,7 +5,7 @@ module OpenTox #@example Authentication # require "opentox-client" # OpenTox::Authorization::AA = "https://opensso.in-silico.ch" #if not set in .opentox/conf/[environment].yaml - # token = OpenTox::Authorization.authenticate("benutzer", "passwort") + # token = OpenTox::Authorization.authenticate("username", "password") #@see http://www.opentox.org/dev/apis/api-1.2/AA OpenTox A&A API 1.2 specification module Authorization @@ -42,11 +42,12 @@ module OpenTox xml = get_xml(uri) ret = false ret = Authorization.create_policy(xml, @subjectid) + $logger.warn "Create policy on openSSO failed for URI: #{uri} subjectid: #{@subjectid}. Will try again." if !ret + ret = Authorization.create_policy(xml, @subjectid) if !ret $logger.debug "Policy send with subjectid: #{@subjectid}" - $logger.warn "Not created Policy is: #{xml}" if !ret + $logger.error "Not created Policy is: #{xml}" if !ret ret end - end #Returns the open-sso server set in the config file .opentox/config/[environment].yaml -- cgit v1.2.3