Sha256: 3eef70b882191755b90e1f72f51b0f2259cf398eb7368ba46d20ef475d51820b

Contents?: true

Size: 1 KB

Versions: 33

Compression:

Stored size: 1 KB

Contents

module Actions
  module Pulp3
    module Repository
      class RefreshDistribution < Pulp3::AbstractAsyncTask
        include Helpers::Presenter

        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
            }
            action = plan_self(refresh_options)

            plan_action(SaveDistributionReferences, repository, smart_proxy, action.output)
          end
        end

        def invoke_external_task
          repo = ::Katello::Repository.find(input[:repository_id])
          repo.backend_service(smart_proxy).with_mirror_adapter.refresh_distributions
        end
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
katello-4.10.0.rc2 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.10.0.rc1 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.8.4 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.9.1 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.8.3 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.9.0 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.8.2 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.9.0.rc2 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.9.0.rc1 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.8.1 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.8.0 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.8.0.rc2 app/lib/actions/pulp3/repository/refresh_distribution.rb
katello-4.8.0.rc1 app/lib/actions/pulp3/repository/refresh_distribution.rb