summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/helper.rb3
-rw-r--r--lib/rest_client_wrapper.rb2
-rw-r--r--lib/task.rb3
3 files changed, 5 insertions, 3 deletions
diff --git a/lib/helper.rb b/lib/helper.rb
index 3a6126a..995f3e9 100644
--- a/lib/helper.rb
+++ b/lib/helper.rb
@@ -44,8 +44,9 @@ helpers do
def uri_available?(urlStr)
url = URI.parse(urlStr)
+ subjectidstr = @subjectid ? "?subjectid=#{CGI.escape @subjectid}" : ""
Net::HTTP.start(url.host, url.port) do |http|
- return http.head("#{url.request_uri}?subjectid=#{CGI.escape @subjectid}").code == "200"
+ return http.head("#{url.request_uri}#{subjectidstr}").code == "200"
end
end
diff --git a/lib/rest_client_wrapper.rb b/lib/rest_client_wrapper.rb
index 747a353..53887a2 100644
--- a/lib/rest_client_wrapper.rb
+++ b/lib/rest_client_wrapper.rb
@@ -131,7 +131,7 @@ module OpenTox
raise "unknown content-type for task : '"+res.content_type.to_s+"'"+" base-uri: "+base_uri.to_s+" content: "+res[0..200].to_s
end
- LOGGER.debug "result is a task '"+task.uri.to_s+"', wait for completion"
+ #LOGGER.debug "result is a task '"+task.uri.to_s+"', wait for completion"
task.wait_for_completion waiting_task
unless task.completed? # maybe task was cancelled / error
if task.errorReport
diff --git a/lib/task.rb b/lib/task.rb
index 42d3d17..146a756 100644
--- a/lib/task.rb
+++ b/lib/task.rb
@@ -288,7 +288,8 @@ module OpenTox
if @http_code == 202
raise "#{@uri}: illegal task state, code is 202, but hasStatus is not Running: '"+@metadata[OT.hasStatus]+"'" unless running?
elsif @http_code == 201
- raise "#{@uri}: illegal task state, code is 201, but hasStatus is not Completed: '"+@metadata[OT.hasStatus]+"'" unless completed?
+ # ignore hasStatus
+ # raise "#{@uri}: illegal task state, code is 201, but hasStatus is not Completed: '"+@metadata[OT.hasStatus]+"'" unless completed?
raise "#{@uri}: illegal task state, code is 201, resultURI is no task-URI: '"+@metadata[OT.resultURI].to_s+
"'" unless @metadata[OT.resultURI] and @metadata[OT.resultURI].to_s.uri?
end