Sha256: 0eef5ab7681e19a4f5c70fb56d2de545399740f13840607c24e13f58f2be52e8

Contents?: true

Size: 937 Bytes

Versions: 42

Compression:

Stored size: 937 Bytes

Contents

module Actions
  module Katello
    module Applicability
      module Hosts
        class BulkGenerate < Actions::EntryAction
          input_format do
            param :host_ids, Array
          end

          def run
            input[:host_ids].each do |host_id|
              content_facet = ::Katello::Host::ContentFacet.find_by_host_id(host_id)
              if content_facet.present?
                content_facet.calculate_and_import_applicability
              else
                Rails.logger.warn(_("Content Facet for host with id %s is non-existent. Skipping applicability calculation.") % host_id)
              end
            end
          end

          def queue
            ::Katello::HOST_TASKS_QUEUE
          end

          def resource_locks
            :link
          end

          def humanized_name
            _("Bulk generate applicability for hosts")
          end
        end
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
katello-4.2.2 app/lib/actions/katello/applicability/hosts/bulk_generate.rb
katello-4.2.1 app/lib/actions/katello/applicability/hosts/bulk_generate.rb
katello-4.2.0.1 app/lib/actions/katello/applicability/hosts/bulk_generate.rb
katello-4.1.4 app/lib/actions/katello/applicability/hosts/bulk_generate.rb
katello-4.0.3 app/lib/actions/katello/applicability/hosts/bulk_generate.rb
katello-4.2.0.1.rc3 app/lib/actions/katello/applicability/hosts/bulk_generate.rb
katello-3.18.5 app/lib/actions/katello/applicability/hosts/bulk_generate.rb
katello-4.2.0.1.rc2 app/lib/actions/katello/applicability/hosts/bulk_generate.rb
katello-4.2.0.rc2 app/lib/actions/katello/applicability/hosts/bulk_generate.rb
katello-4.1.3 app/lib/actions/katello/applicability/hosts/bulk_generate.rb
katello-4.2.0.rc1 app/lib/actions/katello/applicability/hosts/bulk_generate.rb
katello-4.0.2.1 app/lib/actions/katello/applicability/hosts/bulk_generate.rb
katello-4.1.2.1 app/lib/actions/katello/applicability/hosts/bulk_generate.rb
katello-4.0.2 app/lib/actions/katello/applicability/hosts/bulk_generate.rb
katello-4.1.2 app/lib/actions/katello/applicability/hosts/bulk_generate.rb
katello-3.18.4 app/lib/actions/katello/applicability/hosts/bulk_generate.rb
katello-4.1.1 app/lib/actions/katello/applicability/hosts/bulk_generate.rb
katello-4.1.0 app/lib/actions/katello/applicability/hosts/bulk_generate.rb
katello-4.0.1.2 app/lib/actions/katello/applicability/hosts/bulk_generate.rb
katello-3.18.3.1 app/lib/actions/katello/applicability/hosts/bulk_generate.rb