Class: Actions::ForemanCveScanner::CveScannerJob
- Inherits:
-
EntryAction
- Object
- EntryAction
- Actions::ForemanCveScanner::CveScannerJob
- Defined in:
- app/lib/actions/foreman_cve_scanner/cve_scanner_job.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.subscribe ⇒ Object
6 7 8 |
# File 'app/lib/actions/foreman_cve_scanner/cve_scanner_job.rb', line 6 def self.subscribe Actions::RemoteExecution::RunHostJob end |
Instance Method Details
#finalize(*_args) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/lib/actions/foreman_cve_scanner/cve_scanner_job.rb', line 16 def finalize(*_args) host = Host.find(input[:host_id]) return if host.blank? report = { 'host' => host.name, 'logs' => [], 'scan' => format_output(task.main_action.continuous_output.humanize), 'reported_at' => Time.now.utc.to_s, 'reporter' => 'cve_scan' } ConfigReportImporter.import(report) end |
#plan(job_invocation, host, *_args) ⇒ Object
10 11 12 13 14 |
# File 'app/lib/actions/foreman_cve_scanner/cve_scanner_job.rb', line 10 def plan(job_invocation, host, *_args) return unless correct_feature?(job_invocation, 'run_cve_scan') plan_self(host_id: host.id, job_invocation_id: job_invocation.id) end |