Sha256: 07d970838b236d547ceb2aa375187e1cbddd301b46196e92149245f2c6dc38b2

Contents?: true

Size: 847 Bytes

Versions: 59

Compression:

Stored size: 847 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 rh_cloud_inventory:report:generate"
      end

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

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
foreman_rh_cloud-4.0.36 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-3.0.33 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-4.0.35 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-3.0.32 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-4.0.32 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-4.0.31 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-4.0.30 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-3.0.29 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-4.0.29 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-3.0.28 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-4.0.27 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-3.0.26 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-4.0.26 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-4.0.25.1 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-3.0.25 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-4.0.25 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-3.0.24.1 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-4.0.24.1 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-3.0.24 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-4.0.24 lib/foreman_inventory_upload/async/generate_report_job.rb