diff --git a/app/models/ext_management_system.rb b/app/models/ext_management_system.rb index da2405e20e00..a72dd2a40b17 100644 --- a/app/models/ext_management_system.rb +++ b/app/models/ext_management_system.rb @@ -217,6 +217,10 @@ def self.create_discovered_ems(ost) end end + def self.raw_connect?(*params) + !!raw_connect(*params) + end + def self.model_name_from_emstype(emstype) model_from_emstype(emstype).try(:name) end diff --git a/app/models/mixins/authentication_mixin.rb b/app/models/mixins/authentication_mixin.rb index 15a2594ec9a4..2bb3afeba895 100644 --- a/app/models/mixins/authentication_mixin.rb +++ b/app/models/mixins/authentication_mixin.rb @@ -22,7 +22,7 @@ def self.validate_credentials_task(args, user_id, zone) queue_opts = { :args => [*args], :class_name => self, - :method_name => "raw_connect", + :method_name => "raw_connect?", :queue_name => "generic", :role => "ems_operations", :zone => zone diff --git a/spec/models/ext_management_system_spec.rb b/spec/models/ext_management_system_spec.rb index 21ec0a945fc9..57fa8aa6c02f 100644 --- a/spec/models/ext_management_system_spec.rb +++ b/spec/models/ext_management_system_spec.rb @@ -434,4 +434,13 @@ expect(ems.supports_cloud_object_store_container_create).to eq(true) end end + + describe ".raw_connect?" do + it "returns true if validation was successful" do + connection = double + allow(ManageIQ::Providers::Amazon::CloudManager).to receive(:raw_connect).and_return(connection) + + expect(ManageIQ::Providers::Amazon::CloudManager.raw_connect?).to eq(true) + end + end end diff --git a/spec/models/mixins/authentication_mixin_spec.rb b/spec/models/mixins/authentication_mixin_spec.rb index ab5d89834c38..a72b62221a7d 100644 --- a/spec/models/mixins/authentication_mixin_spec.rb +++ b/spec/models/mixins/authentication_mixin_spec.rb @@ -264,7 +264,7 @@ def self.name; "TestClass"; end { :args => [*args], :class_name => ExtManagementSystem, - :method_name => "raw_connect", + :method_name => "raw_connect?", :queue_name => "generic", :role => "ems_operations", :zone => 'zone'