diff --git a/app/models/manageiq/providers/cloud_manager.rb b/app/models/manageiq/providers/cloud_manager.rb index 58263197728..87ceb452e14 100644 --- a/app/models/manageiq/providers/cloud_manager.rb +++ b/app/models/manageiq/providers/cloud_manager.rb @@ -27,7 +27,7 @@ class << model_name has_many :cloud_object_store_objects, :foreign_key => :ems_id, :dependent => :destroy has_many :cloud_services, :foreign_key => :ems_id, :dependent => :destroy has_many :cloud_databases, :foreign_key => :ems_id, :dependent => :destroy - has_many :key_pairs, :class_name => "AuthPrivateKey", :as => :resource, :dependent => :destroy + has_many :key_pairs, :class_name => "AuthKeyPair", :as => :resource, :dependent => :destroy has_many :host_aggregates, :foreign_key => :ems_id, :dependent => :destroy has_one :source_tenant, :as => :source, :class_name => 'Tenant' has_many :vm_and_template_labels, :through => :vms_and_templates, :source => :labels diff --git a/app/models/manageiq/providers/cloud_manager/auth_key_pair.rb b/app/models/manageiq/providers/cloud_manager/auth_key_pair.rb index d8e460d8d9b..73d6abf094c 100644 --- a/app/models/manageiq/providers/cloud_manager/auth_key_pair.rb +++ b/app/models/manageiq/providers/cloud_manager/auth_key_pair.rb @@ -1,4 +1,4 @@ -class ManageIQ::Providers::CloudManager::AuthKeyPair < ::AuthPrivateKey +class ManageIQ::Providers::CloudManager::AuthKeyPair < ::Authentication include AvailabilityMixin acts_as_miq_taggable diff --git a/app/models/manageiq/providers/cloud_manager/provision/options_helper.rb b/app/models/manageiq/providers/cloud_manager/provision/options_helper.rb index fc37c761668..bcd17939d09 100644 --- a/app/models/manageiq/providers/cloud_manager/provision/options_helper.rb +++ b/app/models/manageiq/providers/cloud_manager/provision/options_helper.rb @@ -4,7 +4,7 @@ def dest_availability_zone end def guest_access_key_pair - @guest_access_key_pair ||= AuthPrivateKey.find_by(:id => get_option(:guest_access_key_pair)) + @guest_access_key_pair ||= ManageIQ::Providers::CloudManager::AuthKeyPair.find_by(:id => get_option(:guest_access_key_pair)) end def security_groups diff --git a/spec/models/manageiq/providers/cloud_manager/provision_workflow_spec.rb b/spec/models/manageiq/providers/cloud_manager/provision_workflow_spec.rb index e3140889c34..7c08874feb5 100644 --- a/spec/models/manageiq/providers/cloud_manager/provision_workflow_spec.rb +++ b/spec/models/manageiq/providers/cloud_manager/provision_workflow_spec.rb @@ -85,8 +85,7 @@ end it "#allowed_guest_access_key_pairs" do - kp = AuthPrivateKey.create(:name => "auth_1") - ems.key_pairs << kp + kp = ems.key_pairs.create(:name => "auth_1") expect(workflow.allowed_guest_access_key_pairs).to eq(kp.id => kp.name) end end