Module: Actions::Helpers::WithContinuousOutput

Included in:
WithDelegatedAction
Defined in:
app/lib/actions/helpers/with_continuous_output.rb

Instance Method Summary collapse

Instance Method Details

#continuous_outputObject



10
11
12
13
14
15
16
# File 'app/lib/actions/helpers/with_continuous_output.rb', line 10

def continuous_output
  continuous_output = ::ForemanTasks::ContinuousOutput.new
  continuous_output_providers.each do |continous_output_provider|
    continous_output_provider.fill_continuous_output(continuous_output)
  end
  continuous_output
end

#continuous_output_providersObject

array of objects defining fill_continuous_input



6
7
8
# File 'app/lib/actions/helpers/with_continuous_output.rb', line 6

def continuous_output_providers
  []
end

#fill_planning_errors_to_continuous_output(continuous_output) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'app/lib/actions/helpers/with_continuous_output.rb', line 18

def fill_planning_errors_to_continuous_output(continuous_output)
  execution_plan.errors.map do |e|
    case e.exception
    when ::Actions::ProxyAction::ProxyActionMissing
      continuous_output.add_output(e.message, 'debug', task.started_at)
    else
      continuous_output.add_exception(_('Failed to initialize'), e.exception, task.started_at)
    end
  end
end