Sha256: f41f7e850c705cab4752eccaa1677c9a1c65f3bac6a54f7405f377323c9d943c
Contents?: true
Size: 853 Bytes
Versions: 22
Compression:
Stored size: 853 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) ForemanInventoryUpload::Async::GenerateReportJob.perform_later(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
22 entries across 22 versions & 1 rubygems