Skip to content

Commit

Permalink
Merge pull request #22907 from agrare/add_default_authentication_dele…
Browse files Browse the repository at this point in the history
…gates

Add default_authentication delegates
  • Loading branch information
kbrock authored Feb 23, 2024
2 parents 7affc6b + b4d90dd commit 8cadd6b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/models/ext_management_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,16 @@ def validate_zone_not_maintenance_when_ems_enabled?
:allow_nil => true
delegate :path, :path=, :to => :default_endpoint, :prefix => "endpoint", :allow_nil => true

delegate :userid,
:userid=,
:password,
:password=,
:auth_key,
:auth_key=,
:to => :default_authentication,
:allow_nil => true,
:prefix => :default

alias_method :address, :hostname # TODO: Remove all callers of address

virtual_column :ipaddress, :type => :string, :uses => :endpoints
Expand Down Expand Up @@ -450,6 +460,10 @@ def image_name
emstype.downcase
end

def default_authentication
authentication_type(default_authentication_type) || authentications.build(:authtype => default_authentication_type)
end

def default_endpoint
default = endpoints.detect { |e| e.role == "default" }
default || endpoints.build(:role => "default")
Expand Down

0 comments on commit 8cadd6b

Please sign in to comment.