Sha256: 9b84344c885ca15a5a8bf32ff3f7c4369ed23adcabe77a77ac045be92a33c59c

Contents?: true

Size: 845 Bytes

Versions: 18

Compression:

Stored size: 845 Bytes

Contents

module Actions
  module Katello
    module Host
      class GenerateApplicability < Actions::Base
        def plan(hosts, use_queue = true)
          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), :use_queue => use_queue)
          end
        end

        def finalize
          input[:host_ids].each do |host_id|
            if input[:use_queue]
              ::Katello::EventQueue.push_event(::Katello::Events::ImportHostApplicability::EVENT_TYPE, host_id)
            else
              host = ::Host.find(host_id)
              host.content_facet.try(:import_applicability, true) if host
            end
          end
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
katello-3.12.3 app/lib/actions/katello/host/generate_applicability.rb
katello-3.12.2 app/lib/actions/katello/host/generate_applicability.rb
katello-3.13.0.rc1 app/lib/actions/katello/host/generate_applicability.rb
katello-3.12.1 app/lib/actions/katello/host/generate_applicability.rb
katello-3.11.2 app/lib/actions/katello/host/generate_applicability.rb
katello-3.10.2 app/lib/actions/katello/host/generate_applicability.rb
katello-3.12.0 app/lib/actions/katello/host/generate_applicability.rb
katello-3.12.0.rc2 app/lib/actions/katello/host/generate_applicability.rb
katello-3.10.1.1 app/lib/actions/katello/host/generate_applicability.rb
katello-3.12.0.rc1 app/lib/actions/katello/host/generate_applicability.rb
katello-3.10.1 app/lib/actions/katello/host/generate_applicability.rb
katello-3.11.1 app/lib/actions/katello/host/generate_applicability.rb
katello-3.11.0 app/lib/actions/katello/host/generate_applicability.rb
katello-3.11.0.rc2 app/lib/actions/katello/host/generate_applicability.rb
katello-3.11.0.rc1 app/lib/actions/katello/host/generate_applicability.rb
katello-3.10.0 app/lib/actions/katello/host/generate_applicability.rb
katello-3.10.0.rc1.1 app/lib/actions/katello/host/generate_applicability.rb
katello-3.10.0.rc1 app/lib/actions/katello/host/generate_applicability.rb