If @job is exist and monitor_url is not configured, set monitor_url based on SCHED_HOST
Signed-off-by: Wu Zhende wuzhende666@163.com --- lib/monitor.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/monitor.rb b/lib/monitor.rb index f65cfccf1..283cd788d 100755 --- a/lib/monitor.rb +++ b/lib/monitor.rb @@ -24,7 +24,6 @@ class Monitor # 1 means timeout exit @exit_status_code = 0 @defaults = {} - load_default @result = [] @stop_query = {} @reason = nil @@ -33,6 +32,10 @@ class Monitor def load_default return unless @monitor_url == ''
+ if host = @job["SCHED_HOST"] + return @monitor_url = "ws://#{host}:11310/filter" + end + Dir.glob(['/etc/compass-ci/monitor/*.yaml', "#{ENV['HOME']}/.config/compass-ci/monitor/*.yaml"]).each do |file| next unless File.exist? file @@ -98,6 +101,7 @@ class Monitor
def run(timeout = nil) merge_overrides + load_default field_check
@query.each do |k, v|
Why subject is 'get host from job'? It's not reflected for me.
Thanks, RenWen
On Mon, Dec 21, 2020 at 10:51:59AM +0800, Wu Zhende wrote:
If @job is exist and monitor_url is not configured, set monitor_url based on SCHED_HOST
Signed-off-by: Wu Zhende wuzhende666@163.com
lib/monitor.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/monitor.rb b/lib/monitor.rb index f65cfccf1..283cd788d 100755 --- a/lib/monitor.rb +++ b/lib/monitor.rb @@ -24,7 +24,6 @@ class Monitor # 1 means timeout exit @exit_status_code = 0 @defaults = {}
- load_default @result = [] @stop_query = {} @reason = nil
@@ -33,6 +32,10 @@ class Monitor def load_default return unless @monitor_url == ''
- if host = @job["SCHED_HOST"]
return @monitor_url = "ws://#{host}:11310/filter"
- end
- Dir.glob(['/etc/compass-ci/monitor/*.yaml', "#{ENV['HOME']}/.config/compass-ci/monitor/*.yaml"]).each do |file| next unless File.exist? file
@@ -98,6 +101,7 @@ class Monitor
def run(timeout = nil) merge_overrides
load_default field_check
@query.each do |k, v|
-- 2.23.0