Skip to content

Commit

Permalink
Change CloudManager::AuthKeyPair to inherit from Authentication
Browse files Browse the repository at this point in the history
To prevent cloud_manager auth_key_pairs from being returned with other
AuthPrivateKeys change the parent class to Authentication
  • Loading branch information
agrare committed Apr 5, 2019
1 parent 81a9eca commit 321d9d3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/manageiq/providers/cloud_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ManageIQ::Providers::CloudManager::AuthKeyPair < ::AuthPrivateKey
class ManageIQ::Providers::CloudManager::AuthKeyPair < ::Authentication
include AvailabilityMixin

acts_as_miq_taggable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||= Authentication.find_by(:id => get_option(:guest_access_key_pair))
end

def security_groups
Expand Down

0 comments on commit 321d9d3

Please sign in to comment.