Class: Actions::ForemanPatch::Window::Patch
- Inherits:
-
EntryAction
- Object
- EntryAction
- Actions::ForemanPatch::Window::Patch
- Defined in:
- app/lib/actions/foreman_patch/window/patch.rb
Instance Method Summary collapse
- #delay(delay_options, window) ⇒ Object
- #humanized_name ⇒ Object
- #plan(window) ⇒ Object
- #rescue_strategy_for_self ⇒ Object
- #resource_locks ⇒ Object
- #update_window_status(execution_plan) ⇒ Object
- #window ⇒ Object
Instance Method Details
#delay(delay_options, window) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'app/lib/actions/foreman_patch/window/patch.rb', line 11 def delay(, window) window.task_id = task.id window.save! action_subject(window) super , window end |
#humanized_name ⇒ Object
46 47 48 49 50 51 52 |
# File 'app/lib/actions/foreman_patch/window/patch.rb', line 46 def humanized_name if input and input[:window][:name] _('Run Patch Window: %{window}' % {window: input[:window][:name]}) else _('Run Patch Window') end end |
#plan(window) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/lib/actions/foreman_patch/window/patch.rb', line 20 def plan(window) window.task_id = task.id window.save! action_subject(window) sequence do window.rounds.group_by(&:priority).each do |_, groups| concurrence do groups.each do |group| plan_action(Actions::ForemanPatch::Round::Patch, group) end end end end plan_self end |
#rescue_strategy_for_self ⇒ Object
42 43 44 |
# File 'app/lib/actions/foreman_patch/window/patch.rb', line 42 def rescue_strategy_for_self ::Dynflow::Action::Rescue::Fail end |
#resource_locks ⇒ Object
7 8 9 |
# File 'app/lib/actions/foreman_patch/window/patch.rb', line 7 def resource_locks :link end |
#update_window_status(execution_plan) ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'app/lib/actions/foreman_patch/window/patch.rb', line 54 def update_window_status(execution_plan) return unless root_action? case execution_plan.state when :scheduled window.status = 'scheduled' when :pending, :planning, :planned, :running window.status = 'running' when :stopped window.status = 'completed' else window.status = execution_plan.state end window.save! end |
#window ⇒ Object
38 39 40 |
# File 'app/lib/actions/foreman_patch/window/patch.rb', line 38 def window @window ||= ::ForemanPatch::Window.find(input[:window][:id]) end |