Sha256: 8b276860ec2f6caa8eec58988ffa0b23373197d7b0fd3adc290e545caef1ab91

Contents?: true

Size: 1.38 KB

Versions: 9

Compression:

Stored size: 1.38 KB

Contents

module Actions
  module Pulp
    module Repository
      class Refresh < Pulp::Abstract
        def plan(repository)
          plan_action(::Actions::Pulp::Repository::UpdateImporter,
                      :repo_id => repository.pulp_id,
                      :id => repository.importers.first['id'],
                      :config => repository.generate_importer.config
                      )
          existing_distributors = repository.distributors
          concurrence do
            repository.generate_distributors.each do |distributor|
              found = existing_distributors.find { |i| i['distributor_type_id'] == distributor.type_id }
              if found
                plan_action(::Actions::Pulp::Repository::RefreshDistributor,
                            :repo_id => repository.pulp_id,
                            :id => found['id'],
                            :config => distributor.config
                            )
              else
                plan_action(::Actions::Pulp::Repository::AssociateDistributor,
                            :repo_id => repository.pulp_id,
                            :type_id => distributor.type_id,
                            :config => distributor.config,
                            :hash => { :distributor_id => distributor.id }
                            )
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
katello-2.4.5 app/lib/actions/pulp/repository/refresh.rb
katello-2.4.4 app/lib/actions/pulp/repository/refresh.rb
katello-2.4.3 app/lib/actions/pulp/repository/refresh.rb
katello-2.4.2 app/lib/actions/pulp/repository/refresh.rb
katello-2.4.1 app/lib/actions/pulp/repository/refresh.rb
katello-2.4.0 app/lib/actions/pulp/repository/refresh.rb
katello-2.4.0.rc3 app/lib/actions/pulp/repository/refresh.rb
katello-2.4.0.rc2 app/lib/actions/pulp/repository/refresh.rb
katello-2.4.0.rc1 app/lib/actions/pulp/repository/refresh.rb