diff options
author | mguetlein <martin.guetlein@gmail.com> | 2011-08-03 15:26:18 +0200 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2011-08-03 15:26:18 +0200 |
commit | 0c21b5c58977d16c74d7e976d37d5361ffcb63d1 (patch) | |
tree | c42efd6cad5f379b5e0c053f6da93275a54d946a | |
parent | 8087ce3c03cdfda26ab9215e64f655c124dc413b (diff) |
allow task state queued for 202
-rw-r--r-- | lib/task.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/task.rb b/lib/task.rb index 146a756..00499fa 100644 --- a/lib/task.rb +++ b/lib/task.rb @@ -169,6 +169,10 @@ module OpenTox @metadata[OT.hasStatus] == 'Running' end + def queued? + @metadata[OT.hasStatus] == 'Queued' + end + def completed? @metadata[OT.hasStatus] == 'Completed' end @@ -286,7 +290,7 @@ module OpenTox raise "illegal task state, task is completed, resultURI is no URI: '"+@metadata[OT.resultURI].to_s+ "'" unless @metadata[OT.resultURI] and @metadata[OT.resultURI].to_s.uri? if completed? if @http_code == 202 - raise "#{@uri}: illegal task state, code is 202, but hasStatus is not Running: '"+@metadata[OT.hasStatus]+"'" unless running? + raise "#{@uri}: illegal task state, code is 202, but hasStatus is not Running or Queued: '"+@metadata[OT.hasStatus]+"'" unless running? or queued? elsif @http_code == 201 # ignore hasStatus # raise "#{@uri}: illegal task state, code is 201, but hasStatus is not Completed: '"+@metadata[OT.hasStatus]+"'" unless completed? |