Sha256: 93cd33427640e8a642df15ee934d395998dd0fc792bd6bb76eb2d0a9e4c35e12

Contents?: true

Size: 1.24 KB

Versions: 47

Compression:

Stored size: 1.24 KB

Contents

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

        def plan(repository, smart_proxy, options = {})
          plan_self(:repository_id => repository.id,
                             :smart_proxy_id => smart_proxy.id,
                             :options => options)
        end

        def run
          smart_proxy = ::SmartProxy.unscoped.find(input[:smart_proxy_id])
          options = input[:options]
          tasks = options[:tasks]
          repo = ::Katello::Repository.find(input[:repository_id])
          if options[:use_repository_version]
            output[:response] = repo.backend_service(smart_proxy).with_mirror_adapter.refresh_distributions(:use_repository_version => true)
          elsif tasks && tasks[:pulp_tasks] && tasks[:pulp_tasks].first
            publication_href = tasks[:pulp_tasks].first[:created_resources].first
            if publication_href
              output[:response] = repo.backend_service(smart_proxy).with_mirror_adapter.refresh_distributions(:publication => publication_href)
            end
          end
        end
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
katello-3.18.5 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-3.18.4 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-3.18.3.1 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-3.18.3 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-3.18.2.1 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-3.18.2 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-3.17.3 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-3.18.1.1 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-3.17.2 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-3.18.1 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-3.18.0 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-3.17.1 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-3.16.2 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-3.18.0.rc2.1 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-3.18.0.rc2 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-3.17.0 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-3.18.0.rc1 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-3.17.0.rc2.2 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-3.17.0.rc2.1 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-3.16.1.2 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb