Sha256: ce3b46aab79595d00e997c4777dae9705583a913fd428410d8ebca5fc6361fe1
Contents?: true
Size: 892 Bytes
Versions: 15
Compression:
Stored size: 892 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, disconnected) ForemanTasks.async_task(ForemanInventoryUpload::Async::GenerateReportJob, ForemanInventoryUpload.generated_reports_folder, organization_id, disconnected) 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
15 entries across 15 versions & 1 rubygems