
[why] lab_host_files are on the server side and should be read on the server side. Signed-off-by: Li Ping <1477412247@qq.com> --- lib/job.rb | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/lib/job.rb b/lib/job.rb index 867c3d193..087ca226e 100755 --- a/lib/job.rb +++ b/lib/job.rb @@ -354,6 +354,7 @@ class Job if hosts_file hwconfig = load_yaml(hosts_file, {}) @job[source_file_symkey(hosts_file)] = nil + @job["host_file"] = "#{hosts_file}" @job.merge!(hwconfig) { |_k, a, _b| a } # job's key/value has priority over hwconfig @load_hosts_done = true end @@ -369,26 +370,14 @@ class Job return @job.include?('tbox_group') end - def get_lab_hosts_file - lab_hosts_file_name = @job['testbox'] - lab_hosts_file = "#{ENV['CCI_REPOS']}/lab-#{@job['lab']}/hosts/#{lab_hosts_file_name}" - - if File.file?(lab_hosts_file) - lab_hosts_file - else - nil - end - end - def get_hosts_file - lab_hosts_file = get_lab_hosts_file - return lab_hosts_file if lab_hosts_file - hosts_file_name = @job['tbox_group'].split(/\.|--/)[0] hosts_file = "#{LKP_SRC}/hosts/#{hosts_file_name}" - return hosts_file if File.file?(hosts_file) - - raise ArgumentError, "hosts file not exist: #{hosts_file_name}, maybe need check testbox field" + if File.file?(hosts_file) + hosts_file + else + nil + end end def include_files -- 2.23.0