Sha256: e248eaae2b16f52c13887f84707f20a59b973976a100ea2ac5ec87bf5a470383

Contents?: true

Size: 1.28 KB

Versions: 19

Compression:

Stored size: 1.28 KB

Contents

module Actions
  module Pulp3
    module Repository
      class RefreshDistribution < Pulp3::AbstractAsyncTask
        include Helpers::Presenter
        middleware.use Actions::Middleware::ExecuteIfContentsChanged

        def plan(repository, smart_proxy, options = {})
          smart_proxy = SmartProxy.unscoped.find_by(id: smart_proxy) #support bulk actions
          sequence do
            if !repository.unprotected && !options[:assume_content_guard_exists]
              plan_action(::Actions::Pulp3::ContentGuard::Refresh, smart_proxy)
            end

            refresh_options = {
              :repository_id => repository.id,
              :smart_proxy_id => smart_proxy.id
            }
            refresh_options[:contents_changed] if options.key?(:contents_changed)
            action = plan_self(refresh_options)

            plan_action(SaveDistributionReferences, repository, smart_proxy,
                        action.output, :contents_changed => options[:contents_changed])
          end
        end

        def invoke_external_task
          repo = ::Katello::Repository.find(input[:repository_id])
          #used in switchover, need to assume pulp3
          repo.backend_service(smart_proxy, true).with_mirror_adapter.refresh_distributions
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
katello-4.5.0.rc1 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.4.0.2 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.4.0.1 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.3.1 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.4.0 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.4.0.rc2 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.4.0.rc1 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.2.2 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.3.0 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.3.0.rc4 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.3.0.rc3 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.3.0.rc2.1 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.3.0.rc2 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.3.0.rc1 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.2.1 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.2.0.1 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.2.0.1.rc3 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.2.0.1.rc2 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.2.0.rc2 app/lib/actions/pulp3/repository/refresh_distribution.rb