foreman_rh_cloud 9.0.58 → 10.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/services/foreman_rh_cloud/cloud_request_forwarder.rb +1 -1
- data/lib/foreman_inventory_upload/generators/fact_helpers.rb +1 -1
- data/lib/foreman_inventory_upload/generators/slice.rb +0 -1
- data/lib/foreman_inventory_upload.rb +1 -1
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/lib/insights_cloud/async/insights_resolutions_sync.rb +7 -1
- data/lib/tasks/insights.rake +4 -3
- data/package.json +1 -1
- data/test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb +4 -5
- data/test/unit/slice_generator_test.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ff94b0740c89b0b945f90e7feba658b30341a7f8bb5c1fd2e59cdfc68d05969
|
4
|
+
data.tar.gz: b25c4f29a021b554b425d6d464971aed419e3021736730b696710c10e9804670
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c4b8398e71971b211bb7eb5a76f3d4acd2a274eb69cd9c6f33c8961e0824c8f9da3a34e7ae72c438ab9ddc5042f9a4e3aee53bf24c5ad07ce617b3bdba83eee
|
7
|
+
data.tar.gz: a0f2b3d8d0b1ddf1c0bccd5eeef2c818d8f81bf1a05eaa5e9f0a9bacd70368381d362343f5bc454023b258c238127664f4aaac709fe40feae03ae8b400f80f0c
|
@@ -38,7 +38,7 @@ module ForemanRhCloud
|
|
38
38
|
def prepare_forward_payload(original_request, controller_name)
|
39
39
|
forward_payload = original_request.request_parameters[controller_name]
|
40
40
|
|
41
|
-
forward_payload = original_request.raw_post.clone if original_request.post? && original_request.raw_post
|
41
|
+
forward_payload = original_request.raw_post.clone if (original_request.post? || original_request.patch?) && original_request.raw_post
|
42
42
|
forward_payload = original_request.body.read if original_request.put?
|
43
43
|
|
44
44
|
forward_payload = original_request.params.slice(:file, :metadata) if original_request.params[:file]
|
@@ -126,7 +126,6 @@ module ForemanInventoryUpload
|
|
126
126
|
) { |v| os_release_value(*v) }
|
127
127
|
@stream.simple_field('os_kernel_version', fact_value(host, 'uname::release'))
|
128
128
|
@stream.simple_field('arch', host.architecture&.name)
|
129
|
-
@stream.simple_field('subscription_status', host.subscription_status_label)
|
130
129
|
@stream.simple_field('katello_agent_running', false)
|
131
130
|
@stream.simple_field(
|
132
131
|
'infrastructure_type',
|
@@ -75,7 +75,7 @@ module ForemanInventoryUpload
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def self.inventory_export_url
|
78
|
-
tags =
|
78
|
+
tags = CGI.escape("satellite/satellite_instance_id=#{Foreman.instance_id}")
|
79
79
|
inventory_base_url + "?tags=#{tags}"
|
80
80
|
end
|
81
81
|
|
@@ -60,7 +60,13 @@ module InsightsCloud
|
|
60
60
|
|
61
61
|
def write_resolutions(response)
|
62
62
|
all_resolutions = response.map do |rule_id, rule_details|
|
63
|
-
rule_details
|
63
|
+
if rule_details
|
64
|
+
rule_details['resolutions'].map { |resolution| to_resolution_hash(to_rule_id(rule_id), resolution) }
|
65
|
+
else
|
66
|
+
logger.info("Rules response: #{rule_id} #{rule_details}")
|
67
|
+
logger.debug("Response: #{response}\n Failed id #{rule_id}")
|
68
|
+
[]
|
69
|
+
end
|
64
70
|
end.flatten
|
65
71
|
|
66
72
|
InsightsResolution.create(all_resolutions)
|
data/lib/tasks/insights.rake
CHANGED
@@ -15,9 +15,10 @@ namespace :rh_cloud_insights do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
cleaner = ForemanRhCloud::InsightsStatusCleaner.new
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
User.as_anonymous_admin do
|
19
|
+
deleted_count = cleaner.clean(hosts_search)
|
20
|
+
puts "Deleted #{deleted_count} insights statuses"
|
21
|
+
end
|
21
22
|
end
|
22
23
|
|
23
24
|
desc "Re-announce all organizations into Sources on RH cloud."
|
data/package.json
CHANGED
@@ -65,16 +65,15 @@ class CloudRequestForwarderTest < ActiveSupport::TestCase
|
|
65
65
|
end
|
66
66
|
|
67
67
|
test 'should forward patch payload' do
|
68
|
-
|
68
|
+
post_data = 'Random PATCH data'
|
69
69
|
req = ActionDispatch::Request.new(
|
70
70
|
'REQUEST_URI' => '/foo/bar?baz=awesome',
|
71
71
|
'REQUEST_METHOD' => 'PATCH',
|
72
72
|
'rack.input' => ::Puma::NullIO.new,
|
73
|
-
'RAW_POST_DATA' =>
|
74
|
-
"action_dispatch.request.path_parameters" => { :format => "json" }
|
75
|
-
"action_dispatch.request.request_parameters" => { 'vegetables' => params }
|
73
|
+
'RAW_POST_DATA' => post_data,
|
74
|
+
"action_dispatch.request.path_parameters" => { :format => "json" }
|
76
75
|
)
|
77
|
-
assert_equal
|
76
|
+
assert_equal post_data, @forwarder.prepare_forward_payload(req, 'Random PATCH data')
|
78
77
|
end
|
79
78
|
|
80
79
|
test 'should forward file with metadata' do
|
@@ -594,7 +594,7 @@ class SliceGeneratorTest < ActiveSupport::TestCase
|
|
594
594
|
assert_equal '00000000-0000-0000-0000-000000000000', actual['report_slice_id']
|
595
595
|
assert_not_nil(actual_host = actual['hosts'].first)
|
596
596
|
assert_not_nil(actual_profile = actual_host['system_profile'])
|
597
|
-
assert_equal '
|
597
|
+
assert_equal 'gcp', actual_profile['cloud_provider']
|
598
598
|
end
|
599
599
|
|
600
600
|
test 'Identifies Azure cloud provider' do
|
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: 10.0.1
|
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: 2024-
|
11
|
+
date: 2024-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: foreman_ansible
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: foreman-tasks
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: katello
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|