[why] if you add job field like this : os: openeuler os_version: 20.03 os_arch: aarch64
nr_threads: - 1 - 2
then the @jobs=[hash], hash = {"nr_threads"=>[1,2],"os"=>"openeuler","os_arch"=>"aarch64","os_version"=>"20.03"}
if you add job field like this: os os_version os_arch: - openeuler 20.03 aarch64 - openeuler 20 aarch64
nr_threads: - 1 - 2
then the @jobs=[h1, h2], h1={"nr_threads"=>[1, 2],"os"=>"openeuler", "os_version"=>"20.03", "os_arch"=>"aarch64"}
h2={"nr_threads"=>[1, 2],"os"=>"openeuler", "os_version"=>"20", "os_arch"=>"aarch64"}
h1 will split to 2 jobs by function "each_job" Should: job1={"nr_threads"=>1} job2={"nr_threads"=>2} But if "@job2=hash",will get: job1={"nr_threads"=>[1, 2]} job2={"nr_threads"=>[1, 2]}
We need to merge the h2 to @job
Signed-off-by: Bai Jing 799286817@qq.com --- lib/job.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/job.rb b/lib/job.rb index f3b7a092..f8608e94 100755 --- a/lib/job.rb +++ b/lib/job.rb @@ -727,7 +727,8 @@ class Job @jobs.each do |hash| @load_hosts_done = false @job = deepcopy(job) - @job2 = hash + @job.merge!(hash) + @job2 = {} load_defaults load_hosts_config each_job_init
Please ignore it.
On Tue, Nov 17, 2020 at 03:53:51PM +0800, Bai Jing wrote:
[why] if you add job field like this : os: openeuler os_version: 20.03 os_arch: aarch64
nr_threads:
- 1
- 2
then the @jobs=[hash], hash = {"nr_threads"=>[1,2],"os"=>"openeuler","os_arch"=>"aarch64","os_version"=>"20.03"}
if you add job field like this: os os_version os_arch:
- openeuler 20.03 aarch64
- openeuler 20 aarch64
nr_threads:
- 1
- 2
then the @jobs=[h1, h2], h1={"nr_threads"=>[1, 2],"os"=>"openeuler", "os_version"=>"20.03", "os_arch"=>"aarch64"}
h2={"nr_threads"=>[1, 2],"os"=>"openeuler", "os_version"=>"20", "os_arch"=>"aarch64"}
h1 will split to 2 jobs by function "each_job" Should: job1={"nr_threads"=>1} job2={"nr_threads"=>2} But if "@job2=hash",will get: job1={"nr_threads"=>[1, 2]} job2={"nr_threads"=>[1, 2]}
We need to merge the h2 to @job
Signed-off-by: Bai Jing 799286817@qq.com
lib/job.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/job.rb b/lib/job.rb index f3b7a092..f8608e94 100755 --- a/lib/job.rb +++ b/lib/job.rb @@ -727,7 +727,8 @@ class Job @jobs.each do |hash| @load_hosts_done = false @job = deepcopy(job)
@job2 = hash
@job.merge!(hash)
@job2 = {} load_defaults load_hosts_config each_job_init
-- 2.23.0