Sha256: dc5aca3ef1963e1104ea3aa53710b7ed0acaa84370a1a31dec571d4575af441f
Contents?: true
Size: 1.29 KB
Versions: 7
Compression:
Stored size: 1.29 KB
Contents
# frozen_string_literal: true class PreupgradeReport < ::Report belongs_to :job_invocation has_many :preupgrade_report_entries, dependent: :destroy scoped_search on: :job_invocation_id, only_explicit: true def self.create_report(host, data, job_invocation_id) # We don't have specific permissions for the Preupgrade leapp reports, # so we need to skip the permission check for non-admin users. # The user is still required to have permission to run the job and view the hosts. skip_permission_check do report = PreupgradeReport.create host: host, status: 0, job_invocation_id: job_invocation_id, reported_at: DateTime.now.utc data['entries']&.each do |entry| PreupgradeReportEntry.create! entry_params(report, entry, host, data) end end end def self.entry_params(report, entry, host, data) { preupgrade_report: report, host_id: host.id, hostname: host.name, title: entry['title'], actor: entry['actor'], audience: entry['audience'], severity: entry['severity'], leapp_run_id: data['leapp_run_id'], summary: entry['summary'], tags: entry['tags'], flags: entry['flags'], detail: entry['detail'] } end end
Version data entries
7 entries across 7 versions & 1 rubygems