[PATCH lkp-tests 3/3] lib/job.rb: change the way get hostname

[why] we can get hostname from the repo lab-z9 or get hostname from lkp-tests/hosts before: get hostname from lab-z9, but the hostname not exist in lkp-tests/hosts the job will puts the error message: hosts_file not exist ... but there is no need to puts such error message, if we have got the hostname from lab-z9 --- lib/job.rb | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/lib/job.rb b/lib/job.rb index 2c06a475..12391b39 100755 --- a/lib/job.rb +++ b/lib/job.rb @@ -334,20 +334,14 @@ class Job 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) - lab_hosts_file = get_lab_hosts_file - if lab_hosts_file - hosts_file = lab_hosts_file - end - - if File.file?(hosts_file) - hosts_file - else - puts("hosts_file not exist: #{hosts_file}, maybe need check testbox field") - nil - end + puts("hosts_file not exist: #{hosts_file_name}, maybe need check testbox field") end def include_files -- 2.23.0

On Thu, Nov 05, 2020 at 09:42:09AM +0800, Li Ping wrote:
[why] we can get hostname from the repo lab-z9 or get hostname from lkp-tests/hosts before: get hostname from lab-z9, but the hostname not exist in lkp-tests/hosts the job will puts the error message: hosts_file not exist ... but there is no need to puts such error message, if we have got the hostname from lab-z9 --- lib/job.rb | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/lib/job.rb b/lib/job.rb index 2c06a475..12391b39 100755 --- a/lib/job.rb +++ b/lib/job.rb @@ -334,20 +334,14 @@ class Job 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]
may be our tbox_group won't happen '--' Thanks, Shenwei
hosts_file = "#{LKP_SRC}/hosts/#{hosts_file_name}" + return hosts_file if File.file?(hosts_file)
- lab_hosts_file = get_lab_hosts_file - if lab_hosts_file - hosts_file = lab_hosts_file - end - - if File.file?(hosts_file) - hosts_file - else - puts("hosts_file not exist: #{hosts_file}, maybe need check testbox field") - nil - end + puts("hosts_file not exist: #{hosts_file_name}, maybe need check testbox field") end
def include_files -- 2.23.0

[why] we can get hostname from the repo lab-z9 or get hostname from lkp-tests/hosts before: get hostname from lab-z9, but the hostname not exist in lkp-tests/hosts the job will puts the error message: hosts_file not exist ... but there is no need to puts such error message, if we have got the hostname from lab-z9 --- lib/job.rb | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/lib/job.rb b/lib/job.rb index 2c06a475..12391b39 100755 --- a/lib/job.rb +++ b/lib/job.rb @@ -334,20 +334,14 @@ class Job 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]
may be our tbox_group won't happen '--'
hosts_file not exist: /home/lys/lkp-tests/hosts/vm-2p8g.kjfkdjf, maybe need check testbox field hosts_file not exist: /home/lys/lkp-tests/hosts/vm-2p8g.kjfkdjf, maybe need check testbox field hosts_file not exist: /home/lys/lkp-tests/hosts/vm-2p8g.kjfkdjf, maybe need check testbox field hosts_file not exist: /home/lys/lkp-tests/hosts/vm-2p8g.kjfkdjf, maybe need check testbox field hosts_file not exist: /home/lys/lkp-tests/hosts/vm-2p8g.kjfkdjf, maybe need check testbox field submit a.yaml, got job_id=crystal.114424 yes, and even lab-z9 also have not got hostname, submit job also will success, and why error message will show 5 times. Thanks, Yinsi
Thanks, Shenwei

On Thu, Nov 05, 2020 at 10:01:41AM +0800, Xiao Shenwei wrote:
On Thu, Nov 05, 2020 at 09:42:09AM +0800, Li Ping wrote:
[why] we can get hostname from the repo lab-z9 or get hostname from lkp-tests/hosts before: get hostname from lab-z9, but the hostname not exist in lkp-tests/hosts the job will puts the error message: hosts_file not exist ... but there is no need to puts such error message, if we have got the hostname from lab-z9 --- lib/job.rb | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/lib/job.rb b/lib/job.rb index 2c06a475..12391b39 100755 --- a/lib/job.rb +++ b/lib/job.rb @@ -334,20 +334,14 @@ class Job 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]
may be our tbox_group won't happen '--'
it should not be pointed out in this patch.
Thanks, Shenwei
hosts_file = "#{LKP_SRC}/hosts/#{hosts_file_name}" + return hosts_file if File.file?(hosts_file)
- lab_hosts_file = get_lab_hosts_file - if lab_hosts_file - hosts_file = lab_hosts_file - end - - if File.file?(hosts_file) - hosts_file - else - puts("hosts_file not exist: #{hosts_file}, maybe need check testbox field") - nil - end + puts("hosts_file not exist: #{hosts_file_name}, maybe need check testbox field") end
def include_files -- 2.23.0

On Thu, Nov 05, 2020 at 09:42:09AM +0800, Li Ping wrote:
[why] we can get hostname from the repo lab-z9
^-- hostname => hostfile may be better -------- Thanks Yu Chuan
or get hostname from lkp-tests/hosts before: get hostname from lab-z9, but the hostname not exist in lkp-tests/hosts the job will puts the error message: hosts_file not exist ... but there is no need to puts such error message, if we have got the hostname from lab-z9 --- lib/job.rb | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/lib/job.rb b/lib/job.rb index 2c06a475..12391b39 100755 --- a/lib/job.rb +++ b/lib/job.rb @@ -334,20 +334,14 @@ class Job 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)
- lab_hosts_file = get_lab_hosts_file - if lab_hosts_file - hosts_file = lab_hosts_file - end - - if File.file?(hosts_file) - hosts_file - else - puts("hosts_file not exist: #{hosts_file}, maybe need check testbox field") - nil - end + puts("hosts_file not exist: #{hosts_file_name}, maybe need check testbox field") end
def include_files -- 2.23.0

On Thu, Nov 05, 2020 at 10:24:43AM +0800, Yu Chuan wrote:
On Thu, Nov 05, 2020 at 09:42:09AM +0800, Li Ping wrote:
[why] we can get hostname from the repo lab-z9
^-- hostname => hostfile may be better
ok, i got it.
-------- Thanks Yu Chuan
or get hostname from lkp-tests/hosts before: get hostname from lab-z9, but the hostname not exist in lkp-tests/hosts the job will puts the error message: hosts_file not exist ... but there is no need to puts such error message, if we have got the hostname from lab-z9 --- lib/job.rb | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/lib/job.rb b/lib/job.rb index 2c06a475..12391b39 100755 --- a/lib/job.rb +++ b/lib/job.rb @@ -334,20 +334,14 @@ class Job 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)
- lab_hosts_file = get_lab_hosts_file - if lab_hosts_file - hosts_file = lab_hosts_file - end - - if File.file?(hosts_file) - hosts_file - else - puts("hosts_file not exist: #{hosts_file}, maybe need check testbox field") - nil - end + puts("hosts_file not exist: #{hosts_file_name}, maybe need check testbox field") end
def include_files -- 2.23.0
participants (4)
-
Li Ping
-
Liu Yinsi
-
Xiao Shenwei
-
Yu Chuan