Sha256: 4e2497261d3ab444238a88fbaa34828b05e8818448d455240c1a7ebd5172242a

Contents?: true

Size: 622 Bytes

Versions: 4

Compression:

Stored size: 622 Bytes

Contents

module Actions
  module Katello
    class BulkAgentAction < Actions::BulkAction
      def plan(agent_action, hosts, args)
        host_ids = hosts.map(&:id)
        dispatch_args = {
          content: args[:content]
        }
        histories = ::Katello::Agent::Dispatcher.dispatch(agent_action.agent_message, host_ids, dispatch_args)

        grouped_histories = {}
        histories.each { |h| grouped_histories[h.host_id] = h.id }
        options = {
          dispatch_histories: grouped_histories,
          content: args[:content]
        }
        super(agent_action, hosts, options)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
katello-4.0.0 app/lib/actions/katello/bulk_agent_action.rb
katello-4.0.0.rc3.1 app/lib/actions/katello/bulk_agent_action.rb
katello-4.0.0.rc3 app/lib/actions/katello/bulk_agent_action.rb
katello-4.0.0.rc2 app/lib/actions/katello/bulk_agent_action.rb