Sha256: 314d7ffe4aa7da4787933ef3164fc2e59172f6d8923d8424b54e3e2efea1a25d

Contents?: true

Size: 1.5 KB

Versions: 21

Compression:

Stored size: 1.5 KB

Contents

module Actions
  module Pulp3
    module Orchestration
      module Repository
        class GenerateMetadata < Pulp3::Abstract
          def plan(repository, smart_proxy, options = {})
            options[:contents_changed] = (options && options.key?(:contents_changed)) ? options[:contents_changed] : true
            publication_content_type = !::Katello::RepositoryTypeManager.find(repository.content_type).pulp3_skip_publication
            sequence do
              if options[:source_repository] && publication_content_type
                plan_self(source_repository_id: options[:source_repository].id, target_repository_id: repository.id)
              elsif publication_content_type
                plan_action(Actions::Pulp3::Repository::CreatePublication, repository, smart_proxy, options)
              end
              plan_action(Actions::Pulp3::ContentGuard::Refresh, smart_proxy) unless repository.unprotected
              plan_action(Actions::Pulp3::Repository::RefreshDistribution, repository, smart_proxy, :contents_changed => options[:contents_changed]) if repository.environment
            end
          end

          def run
            #we don't have to actually generate a publication, we can reuse the old one
            target_repo = ::Katello::Repository.find(input[:target_repository_id])
            source_repo = ::Katello::Repository.find(input[:source_repository_id])
            target_repo.update!(publication_href: source_repo.publication_href)
          end
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
katello-3.17.3 app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb
katello-3.17.2 app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb
katello-3.17.1 app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb
katello-3.16.2 app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb
katello-3.17.0 app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb
katello-3.18.0.rc1 app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb
katello-3.17.0.rc2.2 app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb
katello-3.17.0.rc2.1 app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb
katello-3.16.1.2 app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb
katello-3.16.1.1 app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb
katello-3.17.0.rc2 app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb
katello-3.16.1 app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb
katello-3.17.0.rc1 app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb
katello-3.16.0 app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb
katello-3.16.0.rc5.1 app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb
katello-3.16.0.rc5 app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb
katello-3.16.0.rc4.1 app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb
katello-3.16.0.rc4 app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb
katello-3.16.0.rc3.1 app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb
katello-3.16.0.rc3 app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb