foreman_rh_cloud 4.0.36 → 5.0.28
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/concerns/inventory_upload/report_actions.rb +1 -1
- data/app/controllers/foreman_inventory_upload/reports_controller.rb +1 -1
- data/app/controllers/insights_cloud/api/machine_telemetries_controller.rb +5 -16
- data/app/models/setting/rh_cloud.rb +0 -1
- data/app/models/task_output_line.rb +2 -0
- data/app/models/task_output_status.rb +2 -0
- data/app/services/foreman_rh_cloud/cloud_ping_service.rb +1 -4
- data/app/services/foreman_rh_cloud/cloud_request_forwarder.rb +5 -16
- data/config/package-lock.json.plugin +10551 -7500
- data/db/migrate/20211027000001_create_task_output.foreman_rh_cloud.rb +18 -0
- data/lib/foreman_inventory_upload/async/generate_all_reports_job.rb +11 -7
- data/lib/foreman_inventory_upload/async/generate_report_job.rb +24 -12
- data/lib/foreman_inventory_upload/async/progress_output.rb +5 -28
- data/lib/foreman_inventory_upload/async/queue_for_upload_job.rb +20 -5
- data/lib/foreman_inventory_upload/async/shell_process.rb +17 -4
- data/lib/foreman_inventory_upload/async/upload_report_job.rb +22 -13
- data/lib/foreman_inventory_upload/generators/fact_helpers.rb +1 -3
- data/lib/foreman_inventory_upload/generators/queries.rb +0 -1
- data/lib/foreman_inventory_upload/generators/tags.rb +1 -8
- data/lib/foreman_rh_cloud/engine.rb +12 -22
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/lib/insights_cloud/async/insights_scheduled_sync.rb +11 -7
- data/lib/inventory_sync/async/host_result.rb +5 -0
- data/lib/inventory_sync/async/inventory_full_sync.rb +9 -14
- data/lib/inventory_sync/async/inventory_hosts_sync.rb +6 -2
- data/lib/tasks/rh_cloud_inventory.rake +2 -2
- data/package.json +7 -12
- data/test/controllers/insights_cloud/api/machine_telemetries_controller_test.rb +0 -23
- data/test/controllers/inventory_upload/cloud_status_controller_test.rb +0 -2
- data/test/jobs/inventory_full_sync_test.rb +2 -28
- data/test/jobs/inventory_hosts_sync_test.rb +0 -15
- data/test/jobs/upload_report_job_test.rb +5 -3
- data/test/unit/fact_helpers_test.rb +2 -2
- data/test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb +0 -19
- data/test/unit/services/foreman_rh_cloud/cloud_status_service_test.rb +0 -4
- data/test/unit/shell_process_job_test.rb +3 -1
- data/test/unit/slice_generator_test.rb +0 -12
- data/test/unit/tags_generator_test.rb +0 -15
- data/webpack/ForemanInventoryUpload/Components/AccountList/accountList.scss +8 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.scss +17 -4
- data/webpack/ForemanInventoryUpload/Components/PageHeader/PageTitle.js +29 -17
- data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/__snapshots__/PageTitle.test.js.snap +58 -47
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudPingModal/index.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/PageDescription.js +12 -10
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/__tests__/__snapshots__/PageDescription.test.js.snap +10 -10
- data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/__tests__/__snapshots__/InventoryAutoUpload.test.js.snap +1 -1
- data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/__snapshots__/InsightsTable.test.js.snap +4 -1
- data/webpack/InsightsCloudSync/Components/__tests__/__snapshots__/NoTokenEmptyState.test.js.snap +24 -13
- data/webpack/InsightsCloudSync/__snapshots__/InsightsCloudSync.test.js.snap +1 -1
- data/webpack/__mocks__/foremanReact/components/Head.js +11 -0
- data/webpack/common/Switcher/__tests__/__snapshots__/SwitcherPF4.test.js.snap +1 -0
- metadata +7 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 012fcceed18a6413326df32052bee870b299682bc114d5c3e59954bda33b2475
|
|
4
|
+
data.tar.gz: bb72b384fc54d6c19951c453c69b0ecaae5d26bf844fc85b4d4b56f04e1e76bd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 70904b446fce3a2ca3a794c418aaa1591f4276bd35d1636a629e7361b75c62163fc76ad45caa024752a763ef6a9e6344e979dff8f9e9a017c19ac878f667a649
|
|
7
|
+
data.tar.gz: 4fd0e25610e4848565178f19e5a3ffb1da2d9b1505cd604f18a9276bba931f6fea3fbbddcd6c1e375a9d655a4c0b506c3937d89e9e7899b4aed37ae05c72b542
|
|
@@ -11,7 +11,7 @@ module InventoryUpload
|
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def start_report_generation(organization_id)
|
|
14
|
-
ForemanInventoryUpload::Async::GenerateReportJob
|
|
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)
|
|
@@ -7,7 +7,7 @@ module ForemanInventoryUpload
|
|
|
7
7
|
def last
|
|
8
8
|
label = ForemanInventoryUpload::Async::GenerateReportJob.output_label(params[:organization_id])
|
|
9
9
|
output = ForemanInventoryUpload::Async::ProgressOutput.get(label)&.full_output
|
|
10
|
-
task_label = ForemanInventoryUpload::Async::GenerateAllReportsJob.
|
|
10
|
+
task_label = ForemanInventoryUpload::Async::GenerateAllReportsJob.name
|
|
11
11
|
scheduled = ForemanTasks::Task.where(
|
|
12
12
|
:label => task_label,
|
|
13
13
|
:state => 'scheduled'
|
|
@@ -33,25 +33,14 @@ module InsightsCloud::Api
|
|
|
33
33
|
}, status: @cloud_response.code
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
assign_header(response, @cloud_response, key, false) if key.to_s.start_with?('x_rh_')
|
|
36
|
+
if @cloud_response.headers[:content_disposition]
|
|
37
|
+
return send_data @cloud_response, disposition: @cloud_response.headers[:content_disposition], type: @cloud_response.headers[:content_type]
|
|
39
38
|
end
|
|
40
|
-
|
|
39
|
+
|
|
41
40
|
assign_header(response, @cloud_response, :x_resource_count, true)
|
|
42
|
-
|
|
41
|
+
assign_header(response, @cloud_response, :x_rh_insights_request_id, false)
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
# If there is a Content-Disposition header, it means we are forwarding binary data, send the raw data with proper
|
|
46
|
-
# content type
|
|
47
|
-
send_data @cloud_response, disposition: @cloud_response.headers[:content_disposition], type: @cloud_response.headers[:content_type]
|
|
48
|
-
elsif @cloud_response.headers[:content_type] =~ /zip/
|
|
49
|
-
# if there is no Content-Disposition, but the content type is binary according the content type,
|
|
50
|
-
# forward the request as binry too
|
|
51
|
-
send_data @cloud_response, type: @cloud_response.headers[:content_type]
|
|
52
|
-
else
|
|
53
|
-
render json: @cloud_response, status: @cloud_response.code
|
|
54
|
-
end
|
|
43
|
+
render json: @cloud_response, status: @cloud_response.code
|
|
55
44
|
end
|
|
56
45
|
|
|
57
46
|
def branch_info
|
|
@@ -12,7 +12,6 @@ class Setting::RhCloud < Setting
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def self.default_settings
|
|
15
|
-
return unless ActiveRecord::Base.connection.table_exists?('settings')
|
|
16
15
|
[
|
|
17
16
|
set('allow_auto_inventory_upload', N_('Enable automatic upload of your host inventory to the Red Hat cloud'), true, N_('Automatic inventory upload')),
|
|
18
17
|
set('allow_auto_insights_sync', N_('Enable automatic synchronization of Insights recommendations from the Red Hat cloud'), false, N_('Synchronize recommendations Automatically')),
|
|
@@ -39,9 +39,6 @@ module ForemanRhCloud
|
|
|
39
39
|
certs = candlepin_id_cert(@org)
|
|
40
40
|
return StandardError.new('certificate missing') unless certs
|
|
41
41
|
|
|
42
|
-
cert_checker = Katello::UpstreamConnectionChecker.new(@org)
|
|
43
|
-
cert_checker.assert_connection
|
|
44
|
-
|
|
45
42
|
execute_cloud_request(
|
|
46
43
|
method: :get,
|
|
47
44
|
url: ForemanRhCloud.cert_base_url + "/api/apicast-tests/ping",
|
|
@@ -75,7 +72,7 @@ module ForemanRhCloud
|
|
|
75
72
|
org,
|
|
76
73
|
{
|
|
77
74
|
success: cert_response.is_a?(RestClient::Response),
|
|
78
|
-
error: (cert_response.is_a?(Exception) ? cert_response
|
|
75
|
+
error: (cert_response.is_a?(Exception) ? cert_response.inspect : nil),
|
|
79
76
|
},
|
|
80
77
|
]
|
|
81
78
|
end
|
|
@@ -25,12 +25,11 @@ module ForemanRhCloud
|
|
|
25
25
|
base_params = {
|
|
26
26
|
method: original_request.method,
|
|
27
27
|
payload: forward_payload,
|
|
28
|
-
headers:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}),
|
|
28
|
+
headers: {
|
|
29
|
+
params: forward_params,
|
|
30
|
+
user_agent: http_user_agent(original_request),
|
|
31
|
+
content_type: original_request.media_type,
|
|
32
|
+
},
|
|
34
33
|
}
|
|
35
34
|
base_params.merge(path_params(original_request.path, certs))
|
|
36
35
|
end
|
|
@@ -81,16 +80,6 @@ module ForemanRhCloud
|
|
|
81
80
|
end
|
|
82
81
|
end
|
|
83
82
|
|
|
84
|
-
def original_headers(original_request)
|
|
85
|
-
headers = {
|
|
86
|
-
if_none_match: original_request.if_none_match,
|
|
87
|
-
if_modified_since: original_request.if_modified_since,
|
|
88
|
-
}.compact
|
|
89
|
-
|
|
90
|
-
logger.debug("Sending headers: #{headers}")
|
|
91
|
-
headers
|
|
92
|
-
end
|
|
93
|
-
|
|
94
83
|
def platform_request?
|
|
95
84
|
->(request_path) { request_path.include? '/platform' }
|
|
96
85
|
end
|