Sha256: e8c5d0f60fa0cbeab9f94ab62e27c729af2f8b301e694b80c87aac4a19186902

Contents?: true

Size: 707 Bytes

Versions: 7

Compression:

Stored size: 707 Bytes

Contents

module Actions
  module Katello
    module Host
      class GenerateApplicability < Actions::Base
        middleware.use Actions::Middleware::KeepCurrentUser

        def plan(hosts)
          uuids = hosts.map { |host| host.content_facet.try(:uuid) }.compact
          unless uuids.empty?
            plan_action(Pulp::Consumer::GenerateApplicability, :uuids => uuids)
            plan_self(:host_ids => hosts.map(&:id))
          end
        end

        def finalize
          ::Host.where(:id => input[:host_ids]).each do |host|
            host.content_facet.try(:import_applicability)
            host.get_status(::Katello::ErrataStatus).refresh!
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
katello-3.0.2 app/lib/actions/katello/host/generate_applicability.rb
katello-3.0.1 app/lib/actions/katello/host/generate_applicability.rb
katello-3.0.0 app/lib/actions/katello/host/generate_applicability.rb
katello-3.0.0.rc7 app/lib/actions/katello/host/generate_applicability.rb
katello-3.0.0.rc5 app/lib/actions/katello/host/generate_applicability.rb
katello-3.0.0.rc4 app/lib/actions/katello/host/generate_applicability.rb
katello-3.0.0.rc1 app/lib/actions/katello/host/generate_applicability.rb