Sha256: a3eaf0a9843c3047d58ac7085e74802c5b1fe76b6eb3375ad20f844eb3b95b28
Contents?: true
Size: 864 Bytes
Versions: 35
Compression:
Stored size: 864 Bytes
Contents
module InventoryUpload module ReportActions extend ActiveSupport::Concern class ReportMissingError < Foreman::Exception MESSAGE = N_("The report file %{filename} doesn't exist") def initialize(**params) super(self.class::MESSAGE % params, params) end end def start_report_generation(organization_id) ForemanTasks.async_task(ForemanInventoryUpload::Async::GenerateReportJob, ForemanInventoryUpload.generated_reports_folder, organization_id) end def report_file(organization_id) filename = ForemanInventoryUpload.facts_archive_name(organization_id) files = Dir["{#{ForemanInventoryUpload.uploads_file_path(filename)},#{ForemanInventoryUpload.done_file_path(filename)}}"] raise ReportMissingError.new(filename: filename) if files.empty? [filename, files.first] end end end
Version data entries
35 entries across 35 versions & 1 rubygems