Skip to content

Commit

Permalink
Fixes #37024 - Set virt-who regardless of product presence (#10832)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylenz authored Jan 10, 2024
1 parent 96631cd commit 5cdd5e5
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions app/models/katello/glue/candlepin/pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ def provider?(organization)
providers.any?
end

# rubocop:disable Metrics/MethodLength,Metrics/AbcSize
# rubocop:disable Metrics/CyclomaticComplexity
def import_data(index_hosts_and_activation_keys = false)
pool_attributes = {}.with_indifferent_access
Expand Down Expand Up @@ -161,11 +160,7 @@ def import_data(index_hosts_and_activation_keys = false)
pool_attributes[:unmapped_guest] = true
end

if subscription.try(:redhat?)
pool_attributes[:virt_who] = pool_attributes['virt_limit'] != "0" && pool_attributes['virt_limit'].present?
else
pool_attributes[:virt_who] = false
end
pool_attributes[:virt_who] = (pool_attributes['virt_limit'].present? && pool_attributes['virt_limit'] != "0")

pool_attributes['stack_id'] = pool_json['stackId']
exceptions = pool_attributes.keys.map(&:to_sym) - self.attribute_names.map(&:to_sym)
Expand All @@ -175,7 +170,7 @@ def import_data(index_hosts_and_activation_keys = false)
self.create_product_associations
self.import_hosts if index_hosts_and_activation_keys
end
# rubocop:enable Metrics/MethodLength,Metrics/AbcSize
# rubocop:enable

def create_product_associations
products = self.backend_data["providedProducts"] + self.backend_data["derivedProvidedProducts"]
Expand Down

0 comments on commit 5cdd5e5

Please sign in to comment.