foreman_rh_cloud 8.0.51 → 8.0.52

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a8832ac6130f0c9d6d03f01c4da75144968f1c56670ab64634dc0f25f4ba5e2
4
- data.tar.gz: 1e7e672a81f2ecd51a1514a1035b91e7b686d02efd340dba05b65d0a3064d54d
3
+ metadata.gz: c1d1f1eec1e7f83d5fea8b52102c9966fd8429dd01368150b5c4448ea9d5cb92
4
+ data.tar.gz: 3ecdf1a64c836187cafca7c27b9fba8cef99bb7094f3d09e2dfd085295b8f18e
5
5
  SHA512:
6
- metadata.gz: 7e5c3bb073a864906194caaab77a77f01389e1d0a702c12f429fb6277457e412f89a4fb30e79963236388a1347897c1e611f1cc14a68bb580b8427df3838b42e
7
- data.tar.gz: 7cf5d53689a2b8b396a4bb7d72ffb87dd29d35d5e60c8b4b222708a72f9900aaac7180cae53dc82c1ed7b0ceba5293ec831cb69312281cc9c4bbae06d27f4e31
6
+ metadata.gz: dd8dd41fd2ffbb9f66b075e4dbe73e64f9439dedc08974d73851f6a37262ff26b87fb376df6f8ce5817ee9e90bb185185805b3e5f1bd9f63120919a962794a9f
7
+ data.tar.gz: 4ea0b00bd56be43485483107665dd9fab550dd362fc9e4784732b8174aed5f23527816ee320c7bf00b244f22601c60acf1386791c94909a301ff55cf250d9127
@@ -18,10 +18,12 @@ module Api
18
18
 
19
19
  api :POST, "/organizations/:organization_id/rh_cloud/report", N_("Start report generation")
20
20
  param :organization_id, Integer, required: true, desc: N_("Set the current organization context for the request")
21
+ param :disconnected, :bool, required: false, desc: N_('Generate the report, but do not upload')
21
22
  def generate_report
22
23
  organization_id = params[:organization_id]
24
+ disconnected = params[:disconnected]
23
25
 
24
- start_report_generation(organization_id)
26
+ start_report_generation(organization_id, disconnected)
25
27
 
26
28
  render json: {
27
29
  action_status: 'success',
@@ -10,8 +10,8 @@ module InventoryUpload
10
10
  end
11
11
  end
12
12
 
13
- def start_report_generation(organization_id)
14
- ForemanTasks.async_task(ForemanInventoryUpload::Async::GenerateReportJob, ForemanInventoryUpload.generated_reports_folder, organization_id)
13
+ def start_report_generation(organization_id, disconnected)
14
+ ForemanTasks.async_task(ForemanInventoryUpload::Async::GenerateReportJob, ForemanInventoryUpload.generated_reports_folder, organization_id, disconnected)
15
15
  end
16
16
 
17
17
  def report_file(organization_id)
@@ -21,8 +21,9 @@ module ForemanInventoryUpload
21
21
 
22
22
  def generate
23
23
  organization_id = params[:organization_id]
24
+ disconnected = params[:disconnected]
24
25
 
25
- start_report_generation(organization_id)
26
+ start_report_generation(organization_id, disconnected)
26
27
 
27
28
  render json: {
28
29
  action_status: 'success',
@@ -32,8 +32,8 @@ module ForemanInventoryUpload
32
32
  Dynflow::Action::Rescue::Fail
33
33
  end
34
34
 
35
- def plan_generate_report(folder, organization)
36
- plan_action(ForemanInventoryUpload::Async::GenerateReportJob, folder, organization.id)
35
+ def plan_generate_report(folder, organization, disconnected)
36
+ plan_action(ForemanInventoryUpload::Async::GenerateReportJob, folder, organization.id, disconnected)
37
37
  end
38
38
 
39
39
  def logger
@@ -5,7 +5,7 @@ module ForemanInventoryUpload
5
5
  "report_for_#{label}"
6
6
  end
7
7
 
8
- def plan(base_folder, organization_id)
8
+ def plan(base_folder, organization_id, disconnected)
9
9
  sequence do
10
10
  super(
11
11
  GenerateReportJob.output_label(organization_id),
@@ -17,7 +17,8 @@ module ForemanInventoryUpload
17
17
  QueueForUploadJob,
18
18
  base_folder,
19
19
  ForemanInventoryUpload.facts_archive_name(organization_id),
20
- organization_id
20
+ organization_id,
21
+ disconnected
21
22
  )
22
23
  end
23
24
  end
@@ -1,9 +1,9 @@
1
1
  module ForemanInventoryUpload
2
2
  module Async
3
3
  class QueueForUploadJob < ::Actions::EntryAction
4
- def plan(base_folder, report_file, organization_id)
4
+ def plan(base_folder, report_file, organization_id, disconnected)
5
5
  enqueue_task = plan_self(base_folder: base_folder, report_file: report_file)
6
- plan_upload_report(enqueue_task.output[:enqueued_file_name], organization_id)
6
+ plan_upload_report(enqueue_task.output[:enqueued_file_name], organization_id) unless disconnected
7
7
  end
8
8
 
9
9
  def run
@@ -1,3 +1,3 @@
1
1
  module ForemanRhCloud
2
- VERSION = '8.0.51'.freeze
2
+ VERSION = '8.0.52'.freeze
3
3
  end
@@ -47,7 +47,8 @@ namespace :rh_cloud_inventory do
47
47
  base_folder = ENV['target'] || ForemanInventoryUpload.generated_reports_folder
48
48
  organization_id = ENV['organization_id']
49
49
  report_file = ForemanInventoryUpload.facts_archive_name(organization_id)
50
- ForemanTasks.sync_task(ForemanInventoryUpload::Async::QueueForUploadJob, base_folder, report_file, organization_id)
50
+ disconnected = false
51
+ ForemanTasks.sync_task(ForemanInventoryUpload::Async::QueueForUploadJob, base_folder, report_file, organization_id, disconnected)
51
52
  puts "Uploaded #{report_file}"
52
53
  end
53
54
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foreman_rh_cloud",
3
- "version": "8.0.51",
3
+ "version": "8.0.52",
4
4
  "description": "Inventory Upload =============",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -6,14 +6,15 @@ module InventoryUpload::Api
6
6
 
7
7
  setup do
8
8
  @test_org = FactoryBot.create(:organization)
9
+ @disconnected = false
9
10
  end
10
11
 
11
12
  test 'Starts report generation' do
12
13
  Api::V2::RhCloud::InventoryController.any_instance
13
14
  .expects(:start_report_generation)
14
- .with(@test_org.id.to_s)
15
+ .with(@test_org.id.to_s, @disconnected)
15
16
 
16
- post :generate_report, params: { organization_id: @test_org.id }
17
+ post :generate_report, params: { organization_id: @test_org.id, disconnected: @disconnected}
17
18
 
18
19
  assert_response :success
19
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_rh_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.51
4
+ version: 8.0.52
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-04 00:00:00.000000000 Z
11
+ date: 2023-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: katello