Class: Actions::Katello::Product::ContentCreate

Inherits:
Base
  • Object
show all
Defined in:
app/lib/actions/katello/product/content_create.rb

Instance Method Summary collapse

Instance Method Details

#finalizeObject



34
35
36
37
38
# File 'app/lib/actions/katello/product/content_create.rb', line 34

def finalize
  repository = ::Katello::Repository.find(input[:repository_id])
  repository.content_id = input[:content_id]
  repository.save!
end

#plan(repository) ⇒ Object



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
# File 'app/lib/actions/katello/product/content_create.rb', line 7

def plan(repository)
  sequence do
    content_create = plan_action(Candlepin::Product::ContentCreate,
                                 name:        repository.name,
                                 type:        repository.content_type,
                                 label:       repository.,
                                 content_url: content_url(repository))

    plan_action(Candlepin::Product::ContentAdd,
                product_id: repository.product.cp_id,
                content_id: content_create.output[:response][:id])

    if repository.gpg_key
      plan_action(Candlepin::Product::ContentUpdate,
                  content_id:  content_create.output[:response][:id],
                  name:        repository.name,
                  type:        repository.content_type,
                  label:       repository.,
                  content_url: content_url(repository),
                  gpg_key_url: repository.yum_gpg_key_url)
    end

    plan_self(repository_id: repository.id,
              content_id: content_create.output[:response][:id])
  end
end