From 377d86814d1a7c02fb37dfbfbffc8b64d1dc542a Mon Sep 17 00:00:00 2001 From: Adam Grare Date: Wed, 8 Aug 2018 10:54:54 -0400 Subject: [PATCH] Don't queue metrics capture if metrics unsupported If metrics capture is unsupported by the provider then do not queue perf_capture for targets on that EMS. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1610449 --- app/models/ext_management_system.rb | 4 ++++ app/models/metric/targets.rb | 2 ++ 2 files changed, 6 insertions(+) diff --git a/app/models/ext_management_system.rb b/app/models/ext_management_system.rb index 746a9cf5a2f8..c3c9b4458c51 100644 --- a/app/models/ext_management_system.rb +++ b/app/models/ext_management_system.rb @@ -292,6 +292,10 @@ def supports_authentication?(authtype) authtype.to_s == "default" end + def supports_metrics? + true + end + # UI method for determining which icon to show for a particular EMS def image_name emstype.downcase diff --git a/app/models/metric/targets.rb b/app/models/metric/targets.rb index ac101a55b406..c7bb9bf766a5 100644 --- a/app/models/metric/targets.rb +++ b/app/models/metric/targets.rb @@ -55,6 +55,8 @@ def self.capture_container_targets(emses, _options) targets = [] emses.each do |ems| + next unless ems.supports_metrics? + targets += with_archived(ems.all_container_nodes) targets += with_archived(ems.all_container_groups) targets += with_archived(ems.all_containers)