Sha256: 057596b9756438876e39bd0bb72f2f4ad18deb1acffc396220d00801ed685951

Contents?: true

Size: 697 Bytes

Versions: 3

Compression:

Stored size: 697 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.content_facet.update_errata_status
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
katello-3.1.0.rc1 app/lib/actions/katello/host/generate_applicability.rb
katello-3.0.0.rc3 app/lib/actions/katello/host/generate_applicability.rb
katello-3.0.0.rc2 app/lib/actions/katello/host/generate_applicability.rb