app/models/katello/purpose_role_status.rb in katello-3.11.2 vs app/models/katello/purpose_role_status.rb in katello-3.12.0.rc1
- old
+ new
@@ -1,50 +1,27 @@
module Katello
class PurposeRoleStatus < HostStatus::Status
- VALID = 0
- INVALID = 1
- UNKNOWN = 2
-
def self.status_name
N_('Role')
end
def self.humanized_name
'purpose_role'
end
def to_label(_options = {})
- case status
- when VALID
- N_('Matched')
- when INVALID
- N_('Mismatched')
- else
- N_('Unknown')
- end
+ Katello::PurposeStatus.to_label(status)
end
def to_status(options = {})
- return UNKNOWN unless relevant?
-
- status_override = options[:status_override]
-
- return INVALID if status_override == false
-
- return VALID if status_override || consumer.compliant_role?
-
- INVALID
+ Katello::PurposeStatus.to_status(self, :role_status, options)
end
def relevant?(_options = {})
host.subscription_facet.try(:uuid)
end
def substatus?(_options = {})
true
- end
-
- def consumer
- Katello::Candlepin::Consumer.new(host.subscription_facet.uuid, host.organization.label)
end
end
end