summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrautenberg <rautenberg@in-silico.ch>2012-03-22 12:21:31 +0100
committerrautenberg <rautenberg@in-silico.ch>2012-03-22 12:21:31 +0100
commitb9249a71bc4fd6323f2ec879018f497027a4545a (patch)
tree1dfee5a5693e44d33cef18d49996efc6d676c7de
parente7d213bfbe7ae07e5935a62b2ec0d5eee6318711 (diff)
retry opensso if connection fails (1x) log error if fails twice
-rw-r--r--lib/authorization.rb7
1 files 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