Class: Actions::ForemanLeapp::PreupgradeJob

Inherits:
EntryAction
  • Object
show all
Defined in:
app/lib/actions/foreman_leapp/preupgrade_job.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.subscribeObject



6
7
8
# File 'app/lib/actions/foreman_leapp/preupgrade_job.rb', line 6

def self.subscribe
  Actions::RemoteExecution::RunHostJob
end

Instance Method Details

#finalize(*_args) ⇒ Object



17
18
19
20
21
22
# File 'app/lib/actions/foreman_leapp/preupgrade_job.rb', line 17

def finalize(*_args)
  host = Host.find(input[:host_id])
  leapp_report = format_output(task.main_action.continuous_output.humanize)

  PreupgradeReport.create_report(host, leapp_report, input[:job_invocation_id])
end

#plan(job_invocation, host, *_args) ⇒ Object



10
11
12
13
14
15
# File 'app/lib/actions/foreman_leapp/preupgrade_job.rb', line 10

def plan(job_invocation, host, *_args)
  return unless ::Helpers::JobHelper.correct_feature?(job_invocation, 'leapp_preupgrade') ||
                ::Helpers::JobHelper.correct_feature?(job_invocation, 'leapp_remediation_plan')

  plan_self(host_id: host.id, job_invocation_id: job_invocation.id)
end