[Why] if we add new field in job yaml like this: on_fail: sleep: 300 if will do not add sleep to pp
[How] when add sleep to pp, we check sleep's parent hash, not all job. it will find sleep in on_fail'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..50323d31 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].is_a?(Hash) && !h[k].nil? + @job['pp'][k] = h[k] next end options_hash = @referenced_programs[p_n]