Skip to content

Commit

Permalink
Refs #37696 - only create sub-facet for c2r hosts
Browse files Browse the repository at this point in the history
We do have hosts that have no subscription facet, and should not have
one. Adjust the logic for the c2r fact to only create the missing facet
if the fact was sent, and leave hosts w/o the facet and w/o the fact
alone.
  • Loading branch information
evgeni committed Aug 16, 2024
1 parent 4bd1489 commit 763e72d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/models/katello/host/subscription_facet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ def backend_update_needed?

def self.populate_fields_from_facts(host, parser, _type, _source_proxy)
has_convert2rhel = parser.facts.key?('conversions.env.CONVERT2RHEL_THROUGH_FOREMAN')
return unless host.subscription_facet || has_convert2rhel
# Add in custom convert2rhel fact if system was converted using convert2rhel through Katello
# We want the value nil unless the custom fact is present otherwise we get a 0 in the database which if debugging
# might make you think it was converted2rhel but not with satellite, that is why I have the tenary below.
Expand Down

0 comments on commit 763e72d

Please sign in to comment.