Sha256: d4321e54f4c307e7865eab4e1dfcff6616bcea71614d6a40b9061acd486f16a2

Contents?: true

Size: 1 KB

Versions: 61

Compression:

Stored size: 1 KB

Contents

module Actions
  module Pulp3
    module Repository
      class SaveDistributionReferences < Pulp3::Abstract
        middleware.use Actions::Middleware::ExecuteIfContentsChanged

        def plan(repository, smart_proxy, tasks, options = {})
          plan_self(repository_id: repository.id, smart_proxy_id: smart_proxy.id, tasks: tasks, contents_changed: options[:contents_changed])
        end

        def run
          if input[:tasks] && input[:tasks][:pulp_tasks] && input[:tasks][:pulp_tasks].first
            distribution_hrefs = input[:tasks][:pulp_tasks].map { |task| task[:created_resources].first }
            distribution_hrefs.compact!
            repo = ::Katello::Repository.find(input[:repository_id])
            if distribution_hrefs.any?
              repo.backend_service(smart_proxy, true).save_distribution_references(distribution_hrefs)
            else
              repo.backend_service(smart_proxy, true).update_distribution
            end
          end
        end
      end
    end
  end
end

Version data entries

61 entries across 61 versions & 1 rubygems

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