app/models/katello/subscription_status.rb in katello-3.4.0.rc2 vs app/models/katello/subscription_status.rb in katello-3.4.0

- old
+ new

@@ -33,12 +33,15 @@ when UNKNOWN ::HostStatus::Global::WARN end end - def to_status(_options = {}) + def to_status(options = {}) return UNKNOWN unless host.subscription_facet.try(:uuid) - case Katello::Candlepin::Consumer.new(host.subscription_facet.uuid, host.organization.label).entitlement_status + status_override = options.fetch(:status_override, nil) + status = status_override || Katello::Candlepin::Consumer.new(host.subscription_facet.uuid, host.organization.label).entitlement_status + + case status when Katello::Candlepin::Consumer::ENTITLEMENTS_VALID VALID when Katello::Candlepin::Consumer::ENTITLEMENTS_PARTIAL PARTIAL when Katello::Candlepin::Consumer::ENTITLEMENTS_INVALID