From b5b412aa3847719b3fe530f938ccebde86a4e09e Mon Sep 17 00:00:00 2001 From: Adam Grare Date: Tue, 17 Jul 2018 13:23:02 -0400 Subject: [PATCH] Fix detection of an EMS to use for Storage#scan Fix the detection of an EMS to use for storage smartstate scan. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1601570 --- app/models/storage.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/storage.rb b/app/models/storage.rb index cb5181d7338..ed47411969f 100644 --- a/app/models/storage.rb +++ b/app/models/storage.rb @@ -540,7 +540,7 @@ def smartstate_analysis(miq_task_id = nil) {:name => name, :zone => MiqServer.my_zone} end - ems = emss.detect { |e| smartstate_analysis_count_for_ems_id(e.id) >= ::Settings.storage.max_parallel_scans_per_ems } + ems = emss.detect { |e| smartstate_analysis_count_for_ems_id(e.id) < ::Settings.storage.max_parallel_scans_per_ems } if ems.nil? raise MiqException::MiqQueueRetryLater.new(:deliver_on => Time.now.utc + 1.minute) if qmessage?(method_name) ems = emss.random_element