[Why] some programs in job yaml are not at top level, like if role server: iperf: runtime: 300 in this case, we can not add "runtime: 300" to: pp: iperf:
[How] when traverse job to find program's parameters, in this case, it is iperf, then find it at "if role server:"'s keys, not job's top-level keys.
Signed-off-by: Wei Jihui weijihuiall@163.com --- lib/job.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/job.rb b/lib/job.rb index 995b38bf..9fc7b17f 100755 --- a/lib/job.rb +++ b/lib/job.rb @@ -576,10 +576,10 @@ class Job @job[comment_to_symbol('auto generated by add_pp()')] = nil @job["pp"] = Hash.new() init_program_options() - for_each_in(@job, @referenced_programs.keys) do |_pk, h, p_n, p_args| - k = hash_key_re_string(@job, p_n, @job['pp'].keys) - if k && !@job[k].is_a?(Hash) - @job['pp'][k] = @job[k] + for_each_in(@job, @referenced_programs.keys) do |_pk, h, p_n, _p_args| + k = hash_key_re_string(h, p_n, @job['pp'].keys) + if k && h[k] && !h[k].is_a?(Hash) + @job['pp'][k] = h[k] next end options_hash = @referenced_programs[p_n]