diff --git a/app/models/katello/host/content_facet.rb b/app/models/katello/host/content_facet.rb index 8bf16295db8..81c72769973 100644 --- a/app/models/katello/host/content_facet.rb +++ b/app/models/katello/host/content_facet.rb @@ -206,7 +206,7 @@ def calculate_and_import_applicability ::Katello::Applicability::ApplicableContentHelper.new(self, ::Katello::Erratum, bound_repos).calculate_and_import ::Katello::Applicability::ApplicableContentHelper.new(self, ::Katello::ModuleStream, bound_repos).calculate_and_import update_applicability_counts - self.host&.refresh_statuses(::Katello::HostStatusManager::STATUSES) + self.host&.refresh_statuses([::Katello::ErrataStatus, ::Katello::RhelLifecycleStatus]) end def update_applicability_counts diff --git a/app/models/katello/rhel_lifecycle_status.rb b/app/models/katello/rhel_lifecycle_status.rb index ffc003d8a30..159b30dc34b 100644 --- a/app/models/katello/rhel_lifecycle_status.rb +++ b/app/models/katello/rhel_lifecycle_status.rb @@ -52,12 +52,6 @@ def self.end_of_day(date) } }.freeze - def self.between_dates?(date1, date2) - return nil unless date1.present? && date2.present? - today = Date.today.beginning_of_day.utc - date1.present? && today >= date1.beginning_of_day.utc && today <= date2.end_of_day.utc - end - EOS_WARNING_THRESHOLD = 1.year def self.status_map @@ -75,7 +69,7 @@ def self.status_map end def self.approaching_end_of_category(eos_schedule_index:) - RHEL_EOS_SCHEDULE[eos_schedule_index].select { |k, v| (Time.now.utc .. Time.now.utc + EOS_WARNING_THRESHOLD).cover?(v) } + RHEL_EOS_SCHEDULE[eos_schedule_index].select { |_k, v| (Time.now.utc..Time.now.utc + EOS_WARNING_THRESHOLD).cover?(v) } end def self.to_status(rhel_eos_schedule_index: nil) @@ -90,7 +84,7 @@ def self.to_status(rhel_eos_schedule_index: nil) return APPROACHING_END_OF_MAINTENANCE end end - + full_support_end_date = RHEL_EOS_SCHEDULE[release]['full_support'] maintenance_support_end_date = RHEL_EOS_SCHEDULE[release]['maintenance_support'] extended_support_end_date = RHEL_EOS_SCHEDULE[release]['extended_support'] diff --git a/app/services/katello/registration_manager.rb b/app/services/katello/registration_manager.rb index 5d11ce14e10..625517d17b6 100644 --- a/app/services/katello/registration_manager.rb +++ b/app/services/katello/registration_manager.rb @@ -241,7 +241,11 @@ def finalize_registration(host) host.subscription_facet.update_from_consumer_attributes(host.subscription_facet.candlepin_consumer. consumer_attributes.except(:guestIds, :facts)) host.subscription_facet.save! - host.refresh_statuses(::Katello::HostStatusManager::STATUSES) + host.refresh_statuses([ + ::Katello::ErrataStatus, + ::Katello::SubscriptionStatus, + ::Katello::RhelLifecycleStatus + ]) end def set_host_collections(host, activation_keys)