Class: Actions::Katello::Host::AttachSubscriptions
- Inherits:
-
EntryAction
- Object
- EntryAction
- Actions::Katello::Host::AttachSubscriptions
- Defined in:
- app/lib/actions/katello/host/attach_subscriptions.rb
Instance Method Summary collapse
- #finalize ⇒ Object
- #humanized_name ⇒ Object
- #plan(host, pools_with_quantities) ⇒ Object
- #rescue_strategy ⇒ Object
- #resource_locks ⇒ Object
Instance Method Details
#finalize ⇒ Object
24 25 26 |
# File 'app/lib/actions/katello/host/attach_subscriptions.rb', line 24 def finalize ::Katello::Pool.where(:id => input[:pool_ids]).each(&:import_data) end |
#humanized_name ⇒ Object
32 33 34 35 36 37 38 |
# File 'app/lib/actions/katello/host/attach_subscriptions.rb', line 32 def humanized_name if input.try(:[], :host_name) _('Attach subscriptions to %s') % (input[:host_name] || _('Unknown')) else _('Attach subscriptions') end end |
#plan(host, pools_with_quantities) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/lib/actions/katello/host/attach_subscriptions.rb', line 7 def plan(host, pools_with_quantities) action_subject(host) sequence do pool_ids = [] pools_with_quantities.each do |pool_with_quantities| pool_ids << pool_with_quantities.pool.id pool_with_quantities.quantities.each do |quantity| plan_action(::Actions::Candlepin::Consumer::AttachSubscription, :uuid => host.subscription_facet.uuid, :pool_uuid => pool_with_quantities.pool.cp_id, :quantity => quantity) end end plan_self(:pool_ids => pool_ids, :host_name => host.name) end end |
#rescue_strategy ⇒ Object
28 29 30 |
# File 'app/lib/actions/katello/host/attach_subscriptions.rb', line 28 def rescue_strategy Dynflow::Action::Rescue::Skip end |
#resource_locks ⇒ Object
40 41 42 |
# File 'app/lib/actions/katello/host/attach_subscriptions.rb', line 40 def resource_locks :link end |