foreman_rh_cloud 8.0.52 → 9.0.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/api/v2/rh_cloud/inventory_controller.rb +1 -3
- data/app/controllers/concerns/inventory_upload/report_actions.rb +2 -2
- data/app/controllers/foreman_inventory_upload/reports_controller.rb +1 -2
- data/lib/foreman_inventory_upload/async/generate_all_reports_job.rb +2 -2
- data/lib/foreman_inventory_upload/async/generate_report_job.rb +2 -3
- data/lib/foreman_inventory_upload/async/queue_for_upload_job.rb +2 -2
- data/lib/foreman_inventory_upload/generators/slice.rb +1 -1
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/lib/tasks/rh_cloud_inventory.rake +1 -2
- data/package.json +1 -1
- data/test/controllers/inventory_upload/api/inventory_controller_test.rb +2 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fd555061d766a7bdffb964b4fe5214a22651b2be5ebcc729f7cc689c188b2ee
|
4
|
+
data.tar.gz: 60b2ad4169a6495a372006138848f7faf63d05ec5775dc78ee16c69f0a6fa4df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c93f25c3b1eb2bd0b7a388f6db1dfc506da5ab98a8004752e3e737fa9585c9c226d99d56718c917f933889a06c89230e001bbb99cdf8a0337c8f312321f5f62
|
7
|
+
data.tar.gz: e2f56f3f2135515c5f647d74b89698963bc38d09214f77c3737f159b23f2fde30d90c71cea05df69ca973dd74031a8244f48c3170c3eb7b203b622de02ebe29f
|
@@ -18,12 +18,10 @@ 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')
|
22
21
|
def generate_report
|
23
22
|
organization_id = params[:organization_id]
|
24
|
-
disconnected = params[:disconnected]
|
25
23
|
|
26
|
-
start_report_generation(organization_id
|
24
|
+
start_report_generation(organization_id)
|
27
25
|
|
28
26
|
render json: {
|
29
27
|
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)
|
14
|
+
ForemanTasks.async_task(ForemanInventoryUpload::Async::GenerateReportJob, ForemanInventoryUpload.generated_reports_folder, organization_id)
|
15
15
|
end
|
16
16
|
|
17
17
|
def report_file(organization_id)
|
@@ -21,9 +21,8 @@ module ForemanInventoryUpload
|
|
21
21
|
|
22
22
|
def generate
|
23
23
|
organization_id = params[:organization_id]
|
24
|
-
disconnected = params[:disconnected]
|
25
24
|
|
26
|
-
start_report_generation(organization_id
|
25
|
+
start_report_generation(organization_id)
|
27
26
|
|
28
27
|
render json: {
|
29
28
|
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)
|
36
|
+
plan_action(ForemanInventoryUpload::Async::GenerateReportJob, folder, organization.id)
|
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)
|
9
9
|
sequence do
|
10
10
|
super(
|
11
11
|
GenerateReportJob.output_label(organization_id),
|
@@ -17,8 +17,7 @@ module ForemanInventoryUpload
|
|
17
17
|
QueueForUploadJob,
|
18
18
|
base_folder,
|
19
19
|
ForemanInventoryUpload.facts_archive_name(organization_id),
|
20
|
-
organization_id
|
21
|
-
disconnected
|
20
|
+
organization_id
|
22
21
|
)
|
23
22
|
end
|
24
23
|
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)
|
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)
|
7
7
|
end
|
8
8
|
|
9
9
|
def run
|
@@ -127,7 +127,7 @@ module ForemanInventoryUpload
|
|
127
127
|
@stream.simple_field('os_kernel_version', fact_value(host, 'uname::release'))
|
128
128
|
@stream.simple_field('arch', host.architecture&.name)
|
129
129
|
@stream.simple_field('subscription_status', host.subscription_status_label)
|
130
|
-
@stream.simple_field('katello_agent_running',
|
130
|
+
@stream.simple_field('katello_agent_running', false)
|
131
131
|
@stream.simple_field(
|
132
132
|
'infrastructure_type',
|
133
133
|
ActiveModel::Type::Boolean.new.cast(fact_value(host, 'virt::is_guest')) ? 'virtual' : 'physical'
|
@@ -47,8 +47,7 @@ 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
|
-
|
51
|
-
ForemanTasks.sync_task(ForemanInventoryUpload::Async::QueueForUploadJob, base_folder, report_file, organization_id, disconnected)
|
50
|
+
ForemanTasks.sync_task(ForemanInventoryUpload::Async::QueueForUploadJob, base_folder, report_file, organization_id)
|
52
51
|
puts "Uploaded #{report_file}"
|
53
52
|
end
|
54
53
|
end
|
data/package.json
CHANGED
@@ -6,15 +6,14 @@ module InventoryUpload::Api
|
|
6
6
|
|
7
7
|
setup do
|
8
8
|
@test_org = FactoryBot.create(:organization)
|
9
|
-
@disconnected = false
|
10
9
|
end
|
11
10
|
|
12
11
|
test 'Starts report generation' do
|
13
12
|
Api::V2::RhCloud::InventoryController.any_instance
|
14
13
|
.expects(:start_report_generation)
|
15
|
-
.with(@test_org.id.to_s
|
14
|
+
.with(@test_org.id.to_s)
|
16
15
|
|
17
|
-
post :generate_report, params: { organization_id: @test_org.id
|
16
|
+
post :generate_report, params: { organization_id: @test_org.id }
|
18
17
|
|
19
18
|
assert_response :success
|
20
19
|
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:
|
4
|
+
version: 9.0.51
|
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-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: katello
|