6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb', line 6
def plan(repository, smart_proxy, options = {})
force_publication = options.fetch(:force_publication, repository.publication_href.nil?)
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, smart_proxy_id: smart_proxy.id)
elsif publication_content_type && (force_publication || repository.publication_href.nil? || !repository.using_mirrored_metadata?)
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 Setting[:distribute_archived_cvv] || repository.environment
end
end
|