Class: Actions::Katello::ContentViewVersion::AutoCreateProducts

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

Instance Method Summary collapse

Instance Method Details

#plan(import:) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/lib/actions/katello/content_view_version/auto_create_products.rb', line 5

def plan(import:)
  helper = ::Katello::Pulp3::ContentViewVersion::ImportableProducts.
              new(organization: import.organization,
                  metadata_products: import..products)
  helper.generate!
  concurrence do
    helper.creatable.each do |product|
      plan_action(::Actions::Katello::Product::Create, product[:product], import.organization)
    end
    helper.updatable.each do |product|
      plan_action(::Actions::Katello::Product::Update, product[:product], product[:options])
    end
  end
end