Sha256: 822994c06ab9eeb6ffb45fd24a36cd727b004ffef183aa3be4794a437f110e2f

Contents?: true

Size: 1.09 KB

Versions: 14

Compression:

Stored size: 1.09 KB

Contents

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

      def plan(base_folder, organization_id, disconnected)
        sequence do
          super(
            GenerateReportJob.output_label(organization_id),
            organization_id: organization_id,
            base_folder: base_folder
          )

          plan_action(
            QueueForUploadJob,
            base_folder,
            ForemanInventoryUpload.facts_archive_name(organization_id),
            organization_id,
            disconnected
          )
        end
      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_id
        )
      end

      def base_folder
        input[:base_folder]
      end

      def organization_id
        input[:organization_id]
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
foreman_rh_cloud-9.0.59 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-11.0.2 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-11.0.1 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-11.0.0 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-9.0.58 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-10.0.2 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-9.0.57 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-10.0.1 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-9.0.56 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-9.0.55 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-9.0.54 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-9.0.53 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-9.0.52 lib/foreman_inventory_upload/async/generate_report_job.rb
foreman_rh_cloud-8.0.52 lib/foreman_inventory_upload/async/generate_report_job.rb