foreman_rh_cloud 9.0.51 → 9.0.52
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/api/v2/rh_cloud/inventory_controller.rb +3 -1
- data/app/controllers/concerns/inventory_upload/report_actions.rb +2 -2
- data/app/controllers/foreman_inventory_upload/reports_controller.rb +2 -1
- data/app/views/job_templates/cloud_connector.erb +1 -0
- data/lib/foreman_inventory_upload/async/generate_all_reports_job.rb +2 -2
- data/lib/foreman_inventory_upload/async/generate_report_job.rb +3 -2
- data/lib/foreman_inventory_upload/async/queue_for_upload_job.rb +2 -2
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/lib/tasks/rh_cloud_inventory.rake +2 -1
- data/test/controllers/inventory_upload/api/inventory_controller_test.rb +3 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efe9ed15663853fbcc84791bf80a60625992203a5427cd2bf5edef4152dab0d6
|
4
|
+
data.tar.gz: 705d6d4998291969b8f8a9a3f41db3608fe548dcedec76c7e1923e47caada6ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 816ad23a55fb79c29cf304ee1c8afc5df97087b1c8d6c5796a626f1ed18dd4c2485fa7559af677988c551facd52780c92a57c338e7ee599cff14161a6d881df3
|
7
|
+
data.tar.gz: 5e1a14cf0efa4ca378d10d14add2a08a0e7c6560a4339370f50f8f99c40e7fad05a4675cdde5f6400170e9c067cba063c3fa375f0b4e71e19f0e50c61ac81074
|
@@ -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
|
@@ -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
|
-
|
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
|
@@ -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: 9.0.
|
4
|
+
version: 9.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-
|
11
|
+
date: 2023-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: katello
|
@@ -670,7 +670,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
670
670
|
- !ruby/object:Gem::Version
|
671
671
|
version: '0'
|
672
672
|
requirements: []
|
673
|
-
rubygems_version: 3.
|
673
|
+
rubygems_version: 3.4.10
|
674
674
|
signing_key:
|
675
675
|
specification_version: 4
|
676
676
|
summary: Summary of ForemanRhCloud.
|