app/models/katello/subscription_status.rb in katello-3.14.1 vs app/models/katello/subscription_status.rb in katello-3.15.0.rc1
- old
+ new
@@ -1,7 +1,8 @@
module Katello
class SubscriptionStatus < HostStatus::Status
+ DISABLED = 5
UNSUBSCRIBED_HYPERVISOR = 4
UNKNOWN = 3
INVALID = 2
PARTIAL = 1
VALID = 0
@@ -18,19 +19,23 @@
N_("Partially entitled")
when INVALID
N_("Unentitled")
when UNSUBSCRIBED_HYPERVISOR
N_("Unsubscribed hypervisor")
+ when DISABLED
+ N_("Disabled")
else
N_("Unknown subscription status")
end
end
def to_global(_options = {})
case status
when INVALID
::HostStatus::Global::ERROR
+ when DISABLED
+ ::HostStatus::Global::OK
when VALID
::HostStatus::Global::OK
else
::HostStatus::Global::WARN
end
@@ -41,9 +46,11 @@
status_override = 'unsubscribed_hypervisor' if host.subscription_facet.hypervisor && !host.subscription_facet.candlepin_consumer.entitlements?
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_DISABLED
+ DISABLED
when Katello::Candlepin::Consumer::ENTITLEMENTS_VALID
VALID
when Katello::Candlepin::Consumer::ENTITLEMENTS_PARTIAL
PARTIAL
when Katello::Candlepin::Consumer::ENTITLEMENTS_INVALID