From bf03cf97f1f064470a86351f82480cf3db61fe2d Mon Sep 17 00:00:00 2001 From: Keenan Brock Date: Mon, 30 Oct 2017 16:38:32 -0400 Subject: [PATCH] fix bug in Targets#capture_vm_targets introduced in eef58e1b8f7d0de430 specs in metric_capture expose --- app/models/metric/targets.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/metric/targets.rb b/app/models/metric/targets.rb index 276a80b1e35..ac101a55b40 100644 --- a/app/models/metric/targets.rb +++ b/app/models/metric/targets.rb @@ -130,7 +130,7 @@ def self.capture_storage_targets(hosts) # we want to work with only enabled_hosts, so hosts needs to be further filtered def self.capture_vm_targets(emses, hosts) enabled_host_ids = hosts.select(&:perf_capture_enabled?).index_by(&:id) - emses.flat_map { |e| e.vms.select { |v| enabled_host_ids.include?(v.host_id) && v.state == 'on' && v.supports_capture? } } + emses.flat_map { |e| e.vms.select { |v| enabled_host_ids.key?(v.host_id) && v.state == 'on' && v.supports_capture? } } end # If a Cluster, standalone Host, or Storage is not enabled, skip it.