[Why] Now we add new field in job yaml like this: on_fail: sleep: 300 and we want add sleep to pp, but at pp() function, it only traverse job's keys--->on_fail, this can not find sleep. it should find sleep at on_fail's keys.
[How] when traverse job to find program, in this case, it is sleep, then find it at on_fail's keys, not job's 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 5c2c9517..3fdf8c79 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]