Sha256: 35b15f1e314cacd3face20ac6e44e9c1cc7f6350f766169a51ff2780e9b6d824

Contents?: true

Size: 929 Bytes

Versions: 27

Compression:

Stored size: 929 Bytes

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!
            if distribution_hrefs.any?
              repo = ::Katello::Repository.find(input[:repository_id])
              repo.backend_service(smart_proxy).save_distribution_references(distribution_hrefs)
            end
          end
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
katello-3.15.3.1 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-3.15.3 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-3.15.2 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-3.16.0.rc2 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-3.15.1.1 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-3.16.0.rc1.1 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-3.15.1 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-3.16.0.rc1 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-3.15.0.1 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-3.15.0 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-3.15.0.rc2 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-3.15.0.rc1.3 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-3.15.0.rc1.2 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-3.15.0.rc1.1 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-3.15.0.rc1 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-3.14.1 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-3.13.4 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-3.14.0 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-3.13.3 app/lib/actions/pulp3/repository/save_distribution_references.rb
katello-3.14.0.rc2 app/lib/actions/pulp3/repository/save_distribution_references.rb