On Mon, Feb 01, 2021 at 11:26:44AM +0800, Wu Fengguang wrote:
On Sat, Jan 30, 2021 at 04:34:11PM +0800, Li Ping wrote:
[why]
- load job from result's job yaml has key "my_email", like
my_email: compass-ci-robot@qq.com my_name: compass-ci-robot lab: z9 2. load job from result's job yaml has key "SCHED_HOST" which from /etc/compass-ci/defaults/*.yaml, like SCHED_HOST: 172.168.131.2 SCHED_PORT: 3000
each of these fields needs to be reset when submit job.yaml for
Why? Please list the problem situations. That info is the most valuable part.
server side ==> auto_submit: my_email: compass-ci-rebot@qq.com my_token: xxxx
reproduction task: my_email: user.email my_token: user.token
==> check the field my_token fail
need to reload account_info
and server side use SCHED_HOST: 172.168.131.2 client side can not use 172.168.131.2
need reload SCHED_HOST from $LKP_SRC/include/lab/z9
reprodution task. however, these fields already exist in yaml file, can not to be reload, so delete these fields when submit reproduction job.
Signed-off-by: Li Ping 1477412247@qq.com
lib/job.rb | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/lib/job.rb b/lib/job.rb index 640b25a5f..867c3d193 100755 --- a/lib/job.rb +++ b/lib/job.rb @@ -258,6 +258,13 @@ class Job @overrides.merge!(hash['override']){ |_key, a, _b| a} hash.delete('override') end
Should comment the situation here. The code is detecting that situation by detecting 'id'. Such indirections should normally be well commented.
if hash.has_key?('id')
hash.delete_if { |key, _| key == "SCHED_HOST" }
Directly delete?
hash.delete 'SCHED_HOST'
hash.delete_if { |key, _| key == "SCHED_PORT" }
hash.delete_if { |key, _| key == "my_name" }
hash.delete_if { |key, _| key == "my_email" }
hash.delete_if { |key, _| key == "lab" }
end revise_hash(hash, load_include_yamls(@default_yamls), false) unless @default_yamls.empty? revise_hash(hash, load_include_yamls(@override_yamls), true) unless @override_yamls.empty?
-- 2.23.0