foreman_rh_cloud 5.0.42 → 5.0.44
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/insights_cloud/api/machine_telemetries_controller.rb +11 -5
- 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 +11 -0
- 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: 9635bebb61af6ca7d21d4b4acffb2a7e56076bd4c889917469aba146473b7b2a
|
4
|
+
data.tar.gz: a08402321da845e7e2e2d66b1abeefadd2a8d037c482b808734310ec918032ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c4b6f686cc56e902aa6589d5fc85829b3c1c014dfcf4f16bd8f087f4a1609a807d1d4fc24364fd6bd0196156508da9daacbc97e6d0de91bc265e26600b12b85
|
7
|
+
data.tar.gz: 5e21c1f90bba2f55bba85eb38b3829a0fb3bca3728d1766e6986233d35e8e446812ac35d2903061a104760404d4b3b6386a48a6e9c39565eb8ad3c6c2f972045
|
@@ -33,10 +33,6 @@ 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
|
-
|
40
36
|
# Append redhat-specific headers
|
41
37
|
@cloud_response.headers.each do |key, value|
|
42
38
|
assign_header(response, @cloud_response, key, false) if key.to_s.start_with?('x_rh_')
|
@@ -45,7 +41,17 @@ module InsightsCloud::Api
|
|
45
41
|
assign_header(response, @cloud_response, :x_resource_count, true)
|
46
42
|
headers[Rack::ETAG] = @cloud_response.headers[:etag]
|
47
43
|
|
48
|
-
|
44
|
+
if @cloud_response.headers[:content_disposition]
|
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
|
49
55
|
end
|
50
56
|
|
51
57
|
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,6 +72,17 @@ 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
|
+
|
75
86
|
test "should handle failed authentication to cloud" do
|
76
87
|
net_http_resp = Net::HTTPResponse.new(1.0, 401, "Unauthorized")
|
77
88
|
res = RestClient::Response.create(@body, net_http_resp, @http_req)
|
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: 5.0.
|
4
|
+
version: 5.0.44
|
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:
|
11
|
+
date: 2023-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: katello
|
@@ -674,7 +674,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
674
674
|
- !ruby/object:Gem::Version
|
675
675
|
version: '0'
|
676
676
|
requirements: []
|
677
|
-
rubygems_version: 3.3.
|
677
|
+
rubygems_version: 3.3.26
|
678
678
|
signing_key:
|
679
679
|
specification_version: 4
|
680
680
|
summary: Summary of ForemanRhCloud.
|