Class: Katello::HostStatusManager

Inherits:
Object
  • Object
show all
Defined in:
app/services/katello/host_status_manager.rb

Constant Summary collapse

STATUSES =
[
Katello::ErrataStatus,
Katello::SubscriptionStatus,
Katello::PurposeSlaStatus,
Katello::PurposeRoleStatus,
Katello::PurposeUsageStatus,
Katello::PurposeAddonsStatus,
Katello::PurposeStatus,
Katello::TraceStatus].freeze
PURPOSE_STATUS =
[
Katello::PurposeStatus,
Katello::PurposeAddonsStatus,
Katello::PurposeRoleStatus,
Katello::PurposeSlaStatus,
Katello::PurposeUsageStatus].freeze

Class Method Summary collapse

Class Method Details

.clear_syspurpose_status(hosts) ⇒ Object



24
25
26
27
# File 'app/services/katello/host_status_manager.rb', line 24

def self.clear_syspurpose_status(hosts)
  host_purpose = HostStatus::Status.where(type: ::Katello::HostStatusManager::PURPOSE_STATUS.map(&:to_s)).where('host_id in (?)', hosts.pluck(:id))
  host_purpose.destroy_all
end

.update_subscription_status_to_sca(hosts) ⇒ Object



20
21
22
# File 'app/services/katello/host_status_manager.rb', line 20

def self.update_subscription_status_to_sca(hosts)
  HostStatus::Status.where(host: hosts, type: Katello::SubscriptionStatus.to_s).update(status: Katello::SubscriptionStatus::DISABLED)
end