foreman_rh_cloud 6.0.42.1 → 6.0.43
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/foreman_inventory_upload/uploads_controller.rb +3 -0
- data/app/controllers/insights_cloud/api/machine_telemetries_controller.rb +5 -11
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/lib/inventory_sync/async/host_result.rb +1 -1
- data/package.json +1 -1
- data/test/controllers/insights_cloud/api/machine_telemetries_controller_test.rb +0 -11
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/index.js +14 -1
- data/webpack/InsightsCloudSync/Components/InsightsTable/table.scss +0 -2
- data/webpack/__mocks__/foremanReact/components/ConfirmModal/index.js +3 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9180080890adb316306a32a93c88fd86153d3ddf3acc9d5182831a325b35ca4
|
4
|
+
data.tar.gz: 6a6d744fda10894d04f630e48b1c27a9bc87d4d6ac6af6324e3c2644b69e6948
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39ced1494bc063a49bc6db9917dc067abf9491e5c2f0b1eb5083134dc8cb74ef83cbe4fddabe26cfc2e44204594e3eb48ef23bb5d6c6b987838c3adaacfbc18e
|
7
|
+
data.tar.gz: a84b6d061179e2d9c5a4ab3ba8031c0d3f949bdfd09fe8701435eb3328f87cd1c252602659fe963bfaf22e20feccd9b7242e9dae381a8ccf3ef4b9833c2f42b9
|
@@ -18,6 +18,9 @@ module ForemanInventoryUpload
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def enable_cloud_connector
|
21
|
+
# Set the autoupload to true, since it's required by the feature.
|
22
|
+
Setting[:allow_auto_inventory_upload] = true
|
23
|
+
|
21
24
|
cloud_connector = ForemanRhCloud::CloudConnector.new
|
22
25
|
render json: cloud_connector.install.to_json
|
23
26
|
end
|
@@ -33,6 +33,10 @@ module InsightsCloud::Api
|
|
33
33
|
}, status: @cloud_response.code
|
34
34
|
end
|
35
35
|
|
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]
|
38
|
+
end
|
39
|
+
|
36
40
|
# Append redhat-specific headers
|
37
41
|
@cloud_response.headers.each do |key, value|
|
38
42
|
assign_header(response, @cloud_response, key, false) if key.to_s.start_with?('x_rh_')
|
@@ -41,17 +45,7 @@ module InsightsCloud::Api
|
|
41
45
|
assign_header(response, @cloud_response, :x_resource_count, true)
|
42
46
|
headers[Rack::ETAG] = @cloud_response.headers[:etag]
|
43
47
|
|
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
|
48
|
+
render json: @cloud_response, status: @cloud_response.code
|
55
49
|
end
|
56
50
|
|
57
51
|
def branch_info
|
@@ -11,7 +11,7 @@ module InventorySync
|
|
11
11
|
@per_page = result['per_page']
|
12
12
|
@sub_ids = result["results"].map { |host| host['subscription_manager_id'] }
|
13
13
|
@uuid_by_sub_id = Hash[result["results"].map { |host| [host['subscription_manager_id'], host['id']] }]
|
14
|
-
@uuid_by_fqdn = Hash[result["results"].map { |host| [host['fqdn']
|
14
|
+
@uuid_by_fqdn = Hash[result["results"].map { |host| [host['fqdn'].downcase, host['id']] }]
|
15
15
|
end
|
16
16
|
|
17
17
|
def status_hashes
|
data/package.json
CHANGED
@@ -72,17 +72,6 @@ module InsightsCloud::Api
|
|
72
72
|
assert_equal etag, @response.headers[Rack::ETAG]
|
73
73
|
end
|
74
74
|
|
75
|
-
test "should set content type header to response from cloud" do
|
76
|
-
req = RestClient::Request.new(:method => 'GET', :url => 'http://test.theforeman.org')
|
77
|
-
net_http_resp = Net::HTTPResponse.new(1.0, 200, "OK")
|
78
|
-
net_http_resp[:content_type] = 'application/zip'
|
79
|
-
res = RestClient::Response.create(@body, net_http_resp, req)
|
80
|
-
::ForemanRhCloud::CloudRequestForwarder.any_instance.stubs(:forward_request).returns(res)
|
81
|
-
|
82
|
-
get :forward_request, params: { "path" => "static/v1/release/insights-core.egg" }
|
83
|
-
assert_equal net_http_resp[:content_type], @response.headers['Content-Type']
|
84
|
-
end
|
85
|
-
|
86
75
|
test "should handle failed authentication to cloud" do
|
87
76
|
net_http_resp = Net::HTTPResponse.new(1.0, 401, "Unauthorized")
|
88
77
|
res = RestClient::Response.create(@body, net_http_resp, @http_req)
|
data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/index.js
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { useSelector, useDispatch } from 'react-redux';
|
3
|
+
import { openConfirmModal } from 'foremanReact/components/ConfirmModal';
|
4
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
3
5
|
import { CloudConnectorButton } from './CloudConnectorButton';
|
4
6
|
import { configureCloudConnector } from './CloudConnectorActions';
|
5
7
|
import { selectStatus, selectJobLink } from './CloudConnectorSelectors';
|
@@ -12,7 +14,18 @@ const ConnectedCloudConnectorButton = () => {
|
|
12
14
|
return (
|
13
15
|
<CloudConnectorButton
|
14
16
|
status={status}
|
15
|
-
onClick={() =>
|
17
|
+
onClick={() =>
|
18
|
+
dispatch(
|
19
|
+
openConfirmModal({
|
20
|
+
title: __('Notice'),
|
21
|
+
message: __(
|
22
|
+
'This action will also enable automatic reports upload'
|
23
|
+
),
|
24
|
+
isWarning: true,
|
25
|
+
onConfirm: () => dispatch(configureCloudConnector()),
|
26
|
+
})
|
27
|
+
)
|
28
|
+
}
|
16
29
|
jobLink={jobLink}
|
17
30
|
/>
|
18
31
|
);
|
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: 6.0.
|
4
|
+
version: 6.0.43
|
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: 2022-
|
11
|
+
date: 2022-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: katello
|
@@ -624,6 +624,7 @@ files:
|
|
624
624
|
- webpack/__mocks__/foremanReact/common/I18n.js
|
625
625
|
- webpack/__mocks__/foremanReact/common/MountingService.js
|
626
626
|
- webpack/__mocks__/foremanReact/common/helpers.js
|
627
|
+
- webpack/__mocks__/foremanReact/components/ConfirmModal/index.js
|
627
628
|
- webpack/__mocks__/foremanReact/components/Head.js
|
628
629
|
- webpack/__mocks__/foremanReact/components/Layout/LayoutConstants.js
|
629
630
|
- webpack/__mocks__/foremanReact/components/ToastsList/index.js
|