before fix: lib/job.rb:286:in `get_hosts_file': undefined method `split' for nil:NilClass (NoMethodError) after fix: lib/job.rb:269:in `load_hosts_config': hosts_file doesn't exist: /home/weijihui/lkp-tests/hosts/, please check your testbox (RuntimeError)
Signed-off-by: Wei Jihui weijihui2@huawei.com --- lib/job.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/lib/job.rb b/lib/job.rb index c8b5d82d..72397d8b 100755 --- a/lib/job.rb +++ b/lib/job.rb @@ -265,10 +265,7 @@ class Job return if @job.include?(:no_defaults)
hosts_file = get_hosts_file - if !(File.exist? hosts_file) - raise "hosts_file doesn't exist: #{hosts_file}, please check your testbox" - end - return unless File.exist? hosts_file + File.file?(hosts_file) || raise("hosts_file doesn't exist: #{hosts_file}, please check your testbox")
hwconfig = load_yaml(hosts_file, nil) @job[source_file_symkey(hosts_file)] = nil @@ -283,7 +280,7 @@ class Job tbox_group = tbox_group(@job['testbox']) end
- hosts_file_name = tbox_group.split('--')[0] + hosts_file_name = tbox_group.to_s.split('--')[0] hosts_file = "#{LKP_SRC}/hosts/#{hosts_file_name}" end