Skip to content

Commit

Permalink
Fixes #37043 - Inheritance overrides host facets
Browse files Browse the repository at this point in the history
This of course has the same problem as the rest of Foreman where it
becomes impossible to specify `nil` as the wanted value, since any
unspecified values are automatically inherited.
But it's still better than being entirely unable to set host-specific
values for facets that inherit.
  • Loading branch information
ananace committed Jan 15, 2024
1 parent c109691 commit 04649bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/concerns/facets/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def inherited_attributes(hostgroup, facet_attributes)
_, facet_config = Facets.find_facet_by_class(self, :host)

if facet_config.has_hostgroup_configuration? && hostgroup
facet_attributes = hostgroup.inherited_facet_attributes(facet_config)
facet_attributes = hostgroup.inherited_facet_attributes(facet_config).merge(facet_attributes || {}) { |_, left, right| right || left }
end
facet_attributes
end
Expand Down

0 comments on commit 04649bb

Please sign in to comment.