Sha256: 3360c5b0263d64ac0515b9eaa27e495101175aeb386694fbf771bbabd5b01dca

Contents?: true

Size: 1.22 KB

Versions: 18

Compression:

Stored size: 1.22 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 invoke_external_task
          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]
            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
              repo.backend_service(smart_proxy).with_mirror_adapter.refresh_distributions(:publication => publication_href)
            end
          end
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
katello-4.0.3 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-4.0.2.1 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-4.0.2 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-4.1.1 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-4.1.0 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-4.0.1.2 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-4.1.0.rc2.2 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-4.1.0.rc2.1 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-4.0.1.1 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-4.1.0.rc2 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-4.0.1 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-4.1.0.rc1.1 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-4.1.0.rc1 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-4.0.0 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-4.0.0.rc3.1 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-4.0.0.rc3 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-4.0.0.rc2 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb
katello-4.0.0.rc1 app/lib/actions/pulp3/capsule_content/refresh_distribution.rb