Class: Actions::Katello::AlternateContentSource::Create

Inherits:
EntryAction
  • Object
show all
Includes:
AlternateContentSourceCommon
Defined in:
app/lib/actions/katello/alternate_content_source/create.rb

Instance Method Summary collapse

Methods included from AlternateContentSourceCommon

#create_simplified_acs

Instance Method Details

#humanized_nameObject



26
27
28
# File 'app/lib/actions/katello/alternate_content_source/create.rb', line 26

def humanized_name
  _("Create Alternate Content Source")
end

#plan(acs, smart_proxies, products = nil) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/lib/actions/katello/alternate_content_source/create.rb', line 7

def plan(acs, smart_proxies, products = nil)
  acs.save!
  action_subject(acs)
  if products.present?
    acs.update!(products: products)
  end
  smart_proxies = smart_proxies.present? ? smart_proxies.uniq : []
  concurrence do
    smart_proxies.each do |smart_proxy|
      if acs.custom? || acs.rhui?
        smart_proxy_acs = ::Katello::SmartProxyAlternateContentSource.create(alternate_content_source_id: acs.id, smart_proxy_id: smart_proxy.id)
        plan_action(Pulp3::Orchestration::AlternateContentSource::Create, smart_proxy_acs)
      elsif acs.simplified?
        create_simplified_acs(acs, smart_proxy)
      end
    end
  end
end