Sha256: 97d4e20527410fcdf4d85229e909463a002a8c9f3ffbfa4ae3e0f53e88ee8ba0

Contents?: true

Size: 942 Bytes

Versions: 37

Compression:

Stored size: 942 Bytes

Contents

module Actions
  module Pulp3
    module Repository
      class SaveDistributionReferences < Pulp3::Abstract
        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).save_distribution_references(distribution_hrefs)
            else
              repo.backend_service(smart_proxy).update_distribution
            end
          end
        end
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
katello-4.14.2 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-4.15.0 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-4.15.0.rc2 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-4.15.0.rc1 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-4.14.1 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-4.14.0 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-4.14.0.rc3 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-4.14.0.rc2 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-4.14.0.rc1.1 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-4.14.0.rc1 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-4.13.1 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-4.13.0 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-4.12.1 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-4.13.0.rc1 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-4.12.0 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-4.12.0.rc3 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-4.12.0.rc2 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-4.12.0.rc1 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-4.11.1 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-4.11.0 app/lib/actions/pulp3/repository/save_distribution_references.rb