Sha256: 23ac7fe318713b17bd963116726560319bf4d2a5ace8c1546999c3dbf6d32d18

Contents?: true

Size: 853 Bytes

Versions: 31

Compression:

Stored size: 853 Bytes

Contents

module ForemanInventoryUpload
  module Async
    class GenerateReportJob < ShellProcess
      def self.output_label(label)
        "report_for_#{label}"
      end

      def perform(base_folder, organization)
        @base_folder = base_folder
        @organization = organization

        super(GenerateReportJob.output_label(organization))

        QueueForUploadJob.perform_later(
          base_folder,
          ForemanInventoryUpload.facts_archive_name(organization),
          organization
        )
      end

      def rake_prefix
        'foreman-' unless Rails.env.development?
      end

      def command
        "#{rake_prefix}rake foreman_inventory_upload:report:generate"
      end

      def env
        super.merge(
          'target' => @base_folder,
          'organization_id' => @organization
        )
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
foreman_rh_cloud-0.9.10 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-1.0.10 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-2.0.10 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-2.0.9 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-1.0.9 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-0.9.9 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-0.9.8 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-1.0.8 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-2.0.8 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-0.9.7 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-1.0.7 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-2.0.7 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-0.9.6 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-1.0.6 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-2.0.6 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-0.9.5 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-1.0.5 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-2.0.5 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-0.9.4.1 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-1.0.4.1 lib/foreman_inventory_upload/async/generate_report_job.rb