Sha256: ba632c658ab047d9ab726da743fe2e8350fec21a8fa86fdab2370f0c012a2f34

Contents?: true

Size: 849 Bytes

Versions: 49

Compression:

Stored size: 849 Bytes

Contents

module Actions
  module Katello
    module Applicability
      module Repository
        class Regenerate < Actions::EntryAction
          middleware.use Actions::Middleware::ExecuteIfContentsChanged

          input_format do
            param :repo_id, Integer
            param :contents_changed
          end

          def run
            host_ids = ::Katello::Repository.find(input[:repo_id]).hosts_with_applicability.pluck(:id)
            return if host_ids.empty?

            host_ids.each do |host_id|
              ::Katello::ApplicableHostQueue.push_host(host_id)
            end

            ::Katello::EventQueue.push_event(::Katello::Events::GenerateHostApplicability::EVENT_TYPE, 0)
          end

          def humanized_name
            _("Generate repository applicability")
          end
        end
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
katello-4.0.3 app/lib/actions/katello/applicability/repository/regenerate.rb
katello-3.18.5 app/lib/actions/katello/applicability/repository/regenerate.rb
katello-4.0.2.1 app/lib/actions/katello/applicability/repository/regenerate.rb
katello-4.0.2 app/lib/actions/katello/applicability/repository/regenerate.rb
katello-3.18.4 app/lib/actions/katello/applicability/repository/regenerate.rb
katello-4.0.1.2 app/lib/actions/katello/applicability/repository/regenerate.rb
katello-3.18.3.1 app/lib/actions/katello/applicability/repository/regenerate.rb
katello-4.1.0.rc2.2 app/lib/actions/katello/applicability/repository/regenerate.rb
katello-4.1.0.rc2.1 app/lib/actions/katello/applicability/repository/regenerate.rb
katello-4.0.1.1 app/lib/actions/katello/applicability/repository/regenerate.rb
katello-3.18.3 app/lib/actions/katello/applicability/repository/regenerate.rb
katello-4.1.0.rc2 app/lib/actions/katello/applicability/repository/regenerate.rb
katello-4.0.1 app/lib/actions/katello/applicability/repository/regenerate.rb
katello-4.1.0.rc1.1 app/lib/actions/katello/applicability/repository/regenerate.rb
katello-4.1.0.rc1 app/lib/actions/katello/applicability/repository/regenerate.rb
katello-4.0.0 app/lib/actions/katello/applicability/repository/regenerate.rb
katello-4.0.0.rc3.1 app/lib/actions/katello/applicability/repository/regenerate.rb
katello-4.0.0.rc3 app/lib/actions/katello/applicability/repository/regenerate.rb
katello-3.18.2.1 app/lib/actions/katello/applicability/repository/regenerate.rb
katello-3.18.2 app/lib/actions/katello/applicability/repository/regenerate.rb