[ARVADOS] created: cece10f069d022925dbcf55835f66d14c39c2788
Git user
git at public.curoverse.com
Fri Oct 14 17:13:00 EDT 2016
at cece10f069d022925dbcf55835f66d14c39c2788 (commit)
commit cece10f069d022925dbcf55835f66d14c39c2788
Author: Tom Clegg <tom at curoverse.com>
Date: Fri Oct 14 17:12:51 2016 -0400
3486: Accept false and nil/null as parameter values, and avoid translating nil to false.
diff --git a/sdk/cli/bin/arv-run-pipeline-instance b/sdk/cli/bin/arv-run-pipeline-instance
index 6dc82c5..d6da52a 100755
--- a/sdk/cli/bin/arv-run-pipeline-instance
+++ b/sdk/cli/bin/arv-run-pipeline-instance
@@ -364,22 +364,25 @@ class WhRunPipelineInstance
@components.each do |componentname, component|
component[:script_parameters].each do |parametername, parameter|
parameter = { :value => parameter } unless parameter.is_a? Hash
- value =
- (params["#{componentname}::#{parametername}"] ||
- parameter[:value] ||
- (parameter[:output_of].nil? &&
- (params[parametername.to_s] ||
- parameter[:default])) ||
- nil)
- if value.nil? and
- ![false,'false',0,'0'].index parameter[:required]
- if parameter[:output_of]
- if not @components[parameter[:output_of].intern]
- errors << [componentname, parametername, "output_of refers to nonexistent component '#{parameter[:output_of]}'"]
- end
- next
+ if params.has_key?("#{componentname}::#{parametername}")
+ value = params["#{componentname}::#{parametername}"]
+ elsif parameter.has_key?(:value)
+ value = parameter[:value]
+ elsif parameter.has_key?(:output_of)
+ if !@components[parameter[:output_of].intern]
+ errors << [componentname, parametername, "output_of refers to nonexistent component '#{parameter[:output_of]}'"]
+ else
+ # value will be filled in later when the upstream
+ # component's output becomes known
end
+ next
+ elsif params.has_key?(parametername.to_s)
+ value = params[parametername.to_s]
+ elsif parameter.has_key(:default)
+ value = parameter[:default]
+ else
errors << [componentname, parametername, "required parameter is missing"]
+ next
end
debuglog "parameter #{componentname}::#{parametername} == #{value}"
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list