Skip to content

Commit

Permalink
Fixes #16359 - Fix inherited attrs in host extension
Browse files Browse the repository at this point in the history
  • Loading branch information
Ondrej Prazak committed Aug 29, 2016
1 parent b56ed54 commit f4dae3c
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions app/models/katello/concerns/host_managed_extensions.rb
Expand Up @@ -7,7 +7,7 @@ module HostManagedExtensions

included do
alias_method_chain :validate_media?, :capsule
alias_method_chain :set_hostgroup_defaults, :katello_attributes
alias_method_chain :inherited_attributes, :katello
alias_method_chain :info, :katello
alias_method_chain :smart_proxy_ids, :katello
has_one :content_host, :class_name => "Katello::System", :foreign_key => :host_id,
Expand Down Expand Up @@ -76,14 +76,9 @@ def content_and_puppet_match?
content_facet.lifecycle_environment_id == self.environment.try(:lifecycle_environment).try(:id)
end

def set_hostgroup_defaults_with_katello_attributes
if hostgroup.present?
if content_facet.present?
self.content_facet.kickstart_repository_id ||= hostgroup.inherited_kickstart_repository_id
end
assign_hostgroup_attributes(%w(content_source_id content_view_id lifecycle_environment_id))
end
set_hostgroup_defaults_without_katello_attributes
def inherited_attributes_with_katello
self.content_facet.kickstart_repository_id ||= hostgroup.inherited_kickstart_repository_id if content_facet.present?
inherited_attributes_without_katello.concat(%w(content_source_id content_view_id lifecycle_environment_id))
end

def import_package_profile(simple_packages)
Expand Down

0 comments on commit f4dae3c

Please sign in to comment.