Class: Actions::Katello::Repository::MetadataGenerate

Inherits:
EntryAction
  • Object
show all
Defined in:
app/lib/actions/katello/repository/metadata_generate.rb

Instance Method Summary collapse

Instance Method Details

#plan(repository, options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/lib/actions/katello/repository/metadata_generate.rb', line 5

def plan(repository, options = {})
  root = repository.root
  return if root.is_container_push && repository.library_instance?
  action_subject(repository)
  repository.check_ready_to_act!
  source_repository = options.fetch(:source_repository, nil)
  source_repository ||= repository.target_repository if repository.link?
  smart_proxy = options.fetch(:smart_proxy, SmartProxy.pulp_primary)
  matching_content = options.fetch(:matching_content, false)
  force_publication = options.fetch(:force_publication, false)

  plan_action(Pulp3::Orchestration::Repository::GenerateMetadata,
                repository, smart_proxy,
                :force_publication => force_publication,
                :source_repository => source_repository,
                :matching_content => matching_content)

  if repository.deb? && repository.content && !repository.content.content_url.end_with?(repository.deb_content_url_options)
    plan_action(::Actions::Candlepin::Product::ContentUpdate,
                owner:           repository.organization.label,
                repository_id:   repository.id,
                name:            root.name,
                type:            root.content_type,
                arches:          root.format_arches,
                label:           repository.content.label,
                content_url:     root.custom_content_path,
                gpg_key_url:     repository.yum_gpg_key_url,
                os_versions:     root.os_versions&.join(','),
                metadata_expire: root.)
  end
end

#resource_locksObject



37
38
39
# File 'app/lib/actions/katello/repository/metadata_generate.rb', line 37

def resource_locks
  :link
end