From 73d0ac5992be0919fb2b9fe61d1f99fb41b6c9a8 Mon Sep 17 00:00:00 2001 From: Moti Asayag Date: Tue, 5 Dec 2017 10:06:37 +0200 Subject: [PATCH] Merge pull request #157 from borod108/bugs/1512490logspam Reload provider when api_version available (cherry picked from commit f017be8afd01b5d26858bdf657ebd3157be555e6) https://bugzilla.redhat.com/show_bug.cgi?id=1520956 --- .../providers/redhat/infra_manager/supported_apis_mixin.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/manageiq/providers/redhat/infra_manager/supported_apis_mixin.rb b/app/models/manageiq/providers/redhat/infra_manager/supported_apis_mixin.rb index 7af01d94e..37bff8708 100644 --- a/app/models/manageiq/providers/redhat/infra_manager/supported_apis_mixin.rb +++ b/app/models/manageiq/providers/redhat/infra_manager/supported_apis_mixin.rb @@ -1,9 +1,14 @@ module ManageIQ::Providers::Redhat::InfraManager::SupportedApisMixin def supported_api_versions + reload_if_api_version_available_in_db if api_version.blank? return supported_api_versions_from_sdk(probe_args) if api_version.blank? supported_api_versions_from_db end + def reload_if_api_version_available_in_db + reload if ExtManagementSystem.where(:id => id).select(:api_version).take&.api_version + end + def highest_supported_api_version supported_api_versions.sort.last || '3' end