Sha256: eb3131e7540316d09ad885c685292ad741e99835c19a665789de94ab076467b0

Contents?: true

Size: 669 Bytes

Versions: 56

Compression:

Stored size: 669 Bytes

Contents

module Katello
  module Agent
    class UpdatePackageMessage < BaseMessage
      def initialize(content:, consumer_id:)
        @packages = content
        @consumer_id = consumer_id
        @content_type = 'rpm'
        @method = 'update'
      end

      protected

      def options
        ops = super
        ops[:all] = true if @packages.blank?
        ops
      end

      def units
        return [{ type_id: @content_type, unit_key: {}}] if @packages.blank?

        @packages.map do |package|
          {
            type_id: @content_type,
            unit_key: {
              name: package
            }
          }
        end
      end
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
katello-4.9.2 app/lib/katello/agent/update_package_message.rb
katello-4.8.4 app/lib/katello/agent/update_package_message.rb
katello-4.9.1 app/lib/katello/agent/update_package_message.rb
katello-4.8.3 app/lib/katello/agent/update_package_message.rb
katello-4.9.0 app/lib/katello/agent/update_package_message.rb
katello-4.7.6 app/lib/katello/agent/update_package_message.rb
katello-4.8.2 app/lib/katello/agent/update_package_message.rb
katello-4.9.0.rc2 app/lib/katello/agent/update_package_message.rb
katello-4.9.0.rc1 app/lib/katello/agent/update_package_message.rb
katello-4.8.1 app/lib/katello/agent/update_package_message.rb
katello-4.7.5 app/lib/katello/agent/update_package_message.rb
katello-4.8.0 app/lib/katello/agent/update_package_message.rb
katello-4.8.0.rc2 app/lib/katello/agent/update_package_message.rb
katello-4.7.4 app/lib/katello/agent/update_package_message.rb
katello-4.8.0.rc1 app/lib/katello/agent/update_package_message.rb
katello-4.7.3 app/lib/katello/agent/update_package_message.rb
katello-4.7.2 app/lib/katello/agent/update_package_message.rb
katello-4.7.1 app/lib/katello/agent/update_package_message.rb
katello-4.6.2.1 app/lib/katello/agent/update_package_message.rb
katello-4.6.2 app/lib/katello/agent/update_package_message.rb