projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
3373: arv-run-pipeline-instance: removed .to_json where objects are supplied to ...
[arvados.git]
/
sdk
/
cli
/
bin
/
arv-run-pipeline-instance
diff --git
a/sdk/cli/bin/arv-run-pipeline-instance
b/sdk/cli/bin/arv-run-pipeline-instance
index fecee0b57ba442102466e3216f0578ccf1fa1b04..0fdf27d96ff5ea9a3d56e462d9f6e9a5f6f646fd 100755
(executable)
--- a/
sdk/cli/bin/arv-run-pipeline-instance
+++ b/
sdk/cli/bin/arv-run-pipeline-instance
@@
-243,7
+243,7
@@
class PipelineInstance
end
def self.create(attributes)
result = $client.execute(:api_method => $arvados.pipeline_instances.create,
end
def self.create(attributes)
result = $client.execute(:api_method => $arvados.pipeline_instances.create,
- :body => {
+ :body
_object
=> {
:pipeline_instance => attributes
},
:authenticated => false,
:pipeline_instance => attributes
},
:authenticated => false,
@@
-252,7
+252,7
@@
class PipelineInstance
})
j = JSON.parse result.body, :symbolize_names => true
unless j.is_a? Hash and j[:uuid]
})
j = JSON.parse result.body, :symbolize_names => true
unless j.is_a? Hash and j[:uuid]
- abort "Failed to create pipeline_instance: #{j[:errors] rescue nil} #{j.inspect}"
+ abort "
\n#{Time.now} -- pipeline_template #{@template[:uuid]}\n
Failed to create pipeline_instance: #{j[:errors] rescue nil} #{j.inspect}"
end
debuglog "Created pipeline instance: #{j[:uuid]}"
self.new(j)
end
debuglog "Created pipeline instance: #{j[:uuid]}"
self.new(j)
@@
-262,8
+262,8
@@
class PipelineInstance
:parameters => {
:uuid => @pi[:uuid]
},
:parameters => {
:uuid => @pi[:uuid]
},
- :body => {
- :pipeline_instance => @attributes_to_update
.to_json
+ :body
_object
=> {
+ :pipeline_instance => @attributes_to_update
},
:authenticated => false,
:headers => {
},
:authenticated => false,
:headers => {
@@
-325,10
+325,10
@@
class JobCache
def self.create(pipeline, component, job, create_params)
@cache ||= {}
def self.create(pipeline, component, job, create_params)
@cache ||= {}
- body = {
:job => job }.merge(create_params.select { |k,v| not v.nil? }
)
+ body = {
job: no_nil_values(job)}.merge(no_nil_values(create_params)
)
result = $client.execute(:api_method => $arvados.jobs.create,
result = $client.execute(:api_method => $arvados.jobs.create,
- :body => body,
+ :body
_object
=> body,
:authenticated => false,
:headers => {
authorization: 'OAuth2 '+ENV['ARVADOS_API_TOKEN']
:authenticated => false,
:headers => {
authorization: 'OAuth2 '+ENV['ARVADOS_API_TOKEN']
@@
-346,7
+346,7
@@
class JobCache
msg += "Job submission was: #{body.to_json}"
$client.execute(:api_method => $arvados.logs.create,
msg += "Job submission was: #{body.to_json}"
$client.execute(:api_method => $arvados.logs.create,
- :body => {
+ :body
_object
=> {
:log => {
:object_uuid => pipeline[:uuid],
:event_type => 'stderr',
:log => {
:object_uuid => pipeline[:uuid],
:event_type => 'stderr',
@@
-361,6
+361,12
@@
class JobCache
nil
end
end
nil
end
end
+
+ protected
+
+ def self.no_nil_values(hash)
+ hash.reject { |key, value| value.nil? }
+ end
end
class WhRunPipelineInstance
end
class WhRunPipelineInstance
@@
-412,7
+418,7
@@
class WhRunPipelineInstance
param = params_args.shift.sub /^--/, ''
params[param] = params_args.shift
else
param = params_args.shift.sub /^--/, ''
params[param] = params_args.shift
else
- abort "Syntax error: I do not know what to do with arg \"#{params_args[0]}\""
+ abort "
\n#{Time.now} -- pipeline_template #{@template[:uuid]}\n
Syntax error: I do not know what to do with arg \"#{params_args[0]}\""
end
end
end
end
@@
-441,7
+447,7
@@
class WhRunPipelineInstance
end
end
if !errors.empty?
end
end
if !errors.empty?
- abort "Errors:\n#{errors.collect { |c,p,e| "#{c}::#{p} - #{e}\n" }.join ""}"
+ abort "
\n#{Time.now} -- pipeline_template #{@template[:uuid]}\n
Errors:\n#{errors.collect { |c,p,e| "#{c}::#{p} - #{e}\n" }.join ""}"
end
debuglog "options=" + @options.pretty_inspect
self
end
debuglog "options=" + @options.pretty_inspect
self