katello 4.14.1 → 4.14.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of katello might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +2 -2
- data/app/lib/actions/katello/repository/destroy.rb +1 -5
- data/app/lib/actions/katello/repository/update.rb +1 -5
- data/app/models/katello/concerns/content_facet_host_extensions.rb +12 -36
- data/app/services/katello/registration_manager.rb +7 -1
- data/lib/katello/version.rb +1 -1
- data/webpack/redux/actions/RedHatRepositories/helpers.js +6 -6
- 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: b12dcdfe79518fca3a4ea75673805a2c0bf59f7610c8dc4b847e9ccd5a75c601
|
4
|
+
data.tar.gz: 96e0cbbac6e2cdc80e2522b648c48961785b1107683feaa743e8b4d4dc413729
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e0dce2f09fc537dd70401b230e462b17b8348bfe5579f7d623faf3c635da9d1d22eae7d3d0483961f9f3e448fff393b366c26733cb7ac45cc2af988ca73b5ce
|
7
|
+
data.tar.gz: 5cb76f04bb7a0d7044508979c935c48f7ea6d23533f11c6e7263234216971147380d7282039fde039209fe42d31190f7d587b3e8ce52a6520c826e2fdcb538db
|
@@ -19,8 +19,8 @@ module Katello
|
|
19
19
|
api :GET, "/environments/:environment_id/activation_keys"
|
20
20
|
api :GET, "/organizations/:organization_id/activation_keys"
|
21
21
|
param :organization_id, :number, :desc => N_("organization identifier"), :required => true
|
22
|
-
param :environment_id, :number, :desc => N_("environment identifier")
|
23
|
-
param :content_view_id, :number, :desc => N_("content view identifier")
|
22
|
+
param :environment_id, :number, :desc => N_("environment identifier"), :allow_nil => true
|
23
|
+
param :content_view_id, :number, :desc => N_("content view identifier"), :allow_nil => true
|
24
24
|
param :name, String, :desc => N_("activation key name to filter by")
|
25
25
|
param_group :search, Api::V2::ApiController
|
26
26
|
add_scoped_search_description_for(ActivationKey)
|
@@ -70,11 +70,7 @@ module Actions
|
|
70
70
|
# Remove products from ACS's that contain no repositories which both
|
71
71
|
# match the ACS content type and have a non-nil URL
|
72
72
|
product = repository.product
|
73
|
-
repo_content_types =
|
74
|
-
product.repositories.each do |test_repo|
|
75
|
-
# we need to check id because test_repo will still contain the old, non-nil url
|
76
|
-
repo_content_types.add(test_repo.content_type) if (repository.id != test_repo.id) && test_repo.url.present?
|
77
|
-
end
|
73
|
+
repo_content_types = ::Katello::RootRepository.where(:id => product.repositories.where.not(:id => repository.id).select(:root_id)).where.not(:url => [nil, '']).distinct.pluck(:content_type)
|
78
74
|
::Katello::AlternateContentSource.with_products(product).each do |acs|
|
79
75
|
unless repo_content_types.include?(acs.content_type)
|
80
76
|
acs.products = acs.products - [product]
|
@@ -91,11 +91,7 @@ module Actions
|
|
91
91
|
# Remove products from ACS's that contain no repositories which both
|
92
92
|
# match the ACS content type and have a non-nil URL
|
93
93
|
product = repository.product
|
94
|
-
repo_content_types =
|
95
|
-
product.acs_compatible_repositories.each do |test_repo|
|
96
|
-
# we need to check id because test_repo will still contain the old, non-nil url
|
97
|
-
repo_content_types.add(test_repo.content_type) if (repository.id != test_repo.id) && test_repo.url.present?
|
98
|
-
end
|
94
|
+
repo_content_types = ::Katello::RootRepository.where(:id => product.repositories.where.not(:id => repository.id).select(:root_id)).where.not(:url => [nil, '']).distinct.pluck(:content_type)
|
99
95
|
::Katello::AlternateContentSource.with_products(product).each do |acs|
|
100
96
|
unless repo_content_types.include?(acs.content_type)
|
101
97
|
acs.products = acs.products - [product]
|
@@ -79,22 +79,14 @@ module Katello
|
|
79
79
|
module ClassMethods
|
80
80
|
def find_by_applicable_errata(_key, operator, value)
|
81
81
|
conditions = sanitize_sql_for_conditions(["#{Katello::Erratum.table_name}.errata_id #{operator} ?", value_to_sql(operator, value)])
|
82
|
-
hosts = ::Host::Managed.joins(:applicable_errata).where(conditions)
|
83
|
-
|
84
|
-
{ :conditions => "1=0" }
|
85
|
-
else
|
86
|
-
{ :conditions => "#{::Host::Managed.table_name}.id IN (#{hosts.pluck(:id).join(',')})" }
|
87
|
-
end
|
82
|
+
hosts = ::Host::Managed.joins(:applicable_errata).select(:id).where(conditions)
|
83
|
+
{ :conditions => "#{::Host::Managed.table_name}.id IN (#{hosts.to_sql})" }
|
88
84
|
end
|
89
85
|
|
90
86
|
def find_by_installable_errata(_key, operator, value)
|
91
87
|
conditions = sanitize_sql_for_conditions(["#{Katello::Erratum.table_name}.errata_id #{operator} ?", value_to_sql(operator, value)])
|
92
|
-
facets = Katello::Host::ContentFacet.joins_installable_errata.where(conditions)
|
93
|
-
|
94
|
-
{ :conditions => "1=0" }
|
95
|
-
else
|
96
|
-
{ :conditions => "#{::Host::Managed.table_name}.id IN (#{facets.pluck(:host_id).join(',')})" }
|
97
|
-
end
|
88
|
+
facets = Katello::Host::ContentFacet.joins_installable_errata.select(:host_id).where(conditions)
|
89
|
+
{ :conditions => "#{::Host::Managed.table_name}.id IN (#{facets.to_sql})" }
|
98
90
|
end
|
99
91
|
|
100
92
|
def find_by_applicable_debs(_key, operator, value)
|
@@ -117,42 +109,26 @@ module Katello
|
|
117
109
|
|
118
110
|
def find_by_applicable_rpms(_key, operator, value)
|
119
111
|
conditions = sanitize_sql_for_conditions(["#{Katello::Rpm.table_name}.nvra #{operator} ?", value_to_sql(operator, value)])
|
120
|
-
hosts = ::Host::Managed.joins(:applicable_rpms).where(conditions)
|
121
|
-
|
122
|
-
{ :conditions => "1=0" }
|
123
|
-
else
|
124
|
-
{ :conditions => "#{::Host::Managed.table_name}.id IN (#{hosts.pluck(:id).join(',')})" }
|
125
|
-
end
|
112
|
+
hosts = ::Host::Managed.joins(:applicable_rpms).select(:id).where(conditions)
|
113
|
+
{ :conditions => "#{::Host::Managed.table_name}.id IN (#{hosts.to_sql})" }
|
126
114
|
end
|
127
115
|
|
128
116
|
def find_by_installable_rpms(_key, operator, value)
|
129
117
|
conditions = sanitize_sql_for_conditions(["#{Katello::Rpm.table_name}.nvra #{operator} ?", value_to_sql(operator, value)])
|
130
|
-
facets = Katello::Host::ContentFacet.joins_installable_rpms.where(conditions)
|
131
|
-
|
132
|
-
{ :conditions => "1=0" }
|
133
|
-
else
|
134
|
-
{ :conditions => "#{::Host::Managed.table_name}.id IN (#{facets.pluck(:host_id).join(',')})" }
|
135
|
-
end
|
118
|
+
facets = Katello::Host::ContentFacet.joins_installable_rpms.select(:host_id).where(conditions)
|
119
|
+
{ :conditions => "#{::Host::Managed.table_name}.id IN (#{facets.to_sql})" }
|
136
120
|
end
|
137
121
|
|
138
122
|
def find_by_repository_content_label(_key, operator, value)
|
139
123
|
conditions = sanitize_sql_for_conditions(["#{Katello::Content.table_name}.label #{operator} ?", value_to_sql(operator, value)])
|
140
|
-
facets = Katello::Host::ContentFacet.joins_repositories.where(conditions)
|
141
|
-
|
142
|
-
{ :conditions => "1=0" }
|
143
|
-
else
|
144
|
-
{ :conditions => "#{::Host::Managed.table_name}.id IN (#{facets.pluck(:host_id).join(',')})" }
|
145
|
-
end
|
124
|
+
facets = Katello::Host::ContentFacet.joins_repositories.select(:host_id).where(conditions)
|
125
|
+
{ :conditions => "#{::Host::Managed.table_name}.id IN (#{facets.to_sql})" }
|
146
126
|
end
|
147
127
|
|
148
128
|
def find_by_repository_name(_key, operator, value)
|
149
129
|
conditions = sanitize_sql_for_conditions(["#{Katello::RootRepository.table_name}.name #{operator} ?", value_to_sql(operator, value)])
|
150
|
-
facets = Katello::Host::ContentFacet.joins_repositories.where(conditions)
|
151
|
-
|
152
|
-
{ :conditions => "1=0" }
|
153
|
-
else
|
154
|
-
{ :conditions => "#{::Host::Managed.table_name}.id IN (#{facets.pluck(:host_id).join(',')})" }
|
155
|
-
end
|
130
|
+
facets = Katello::Host::ContentFacet.joins_repositories.select(:host_id).where(conditions)
|
131
|
+
{ :conditions => "#{::Host::Managed.table_name}.id IN (#{facets.to_sql})" }
|
156
132
|
end
|
157
133
|
|
158
134
|
def in_content_view_environments(content_views: nil, lifecycle_environments: nil)
|
@@ -154,13 +154,18 @@ module Katello
|
|
154
154
|
end
|
155
155
|
end
|
156
156
|
|
157
|
+
# rubocop:disable Metrics/MethodLength
|
157
158
|
def register_host(host, consumer_params, content_view_environments, activation_keys = [])
|
158
159
|
new_host = host.new_record?
|
159
160
|
unless new_host
|
160
161
|
host.save!
|
161
162
|
# Keep the kickstart repository ID so the host's Medium isn't unset
|
162
163
|
# Important for registering a host during provisioning
|
163
|
-
|
164
|
+
begin
|
165
|
+
unregister_host(host, :unregistering => true, :keep_kickstart_repository => true)
|
166
|
+
rescue RestClient::Gone
|
167
|
+
Rails.logger.debug("Host %s has been removed in preparation for reregistration" % host&.name)
|
168
|
+
end
|
164
169
|
host.reload
|
165
170
|
end
|
166
171
|
|
@@ -194,6 +199,7 @@ module Katello
|
|
194
199
|
finalize_registration(host)
|
195
200
|
end
|
196
201
|
end
|
202
|
+
# rubocop:enable Metrics/MethodLength
|
197
203
|
|
198
204
|
def check_registration_services
|
199
205
|
ping_results = {}
|
data/lib/katello/version.rb
CHANGED
@@ -28,15 +28,15 @@ const recommendedRepositoriesSatTools = [
|
|
28
28
|
'satellite-client-6-for-rhel-9-x86_64-rpms',
|
29
29
|
'satellite-client-6-for-rhel-8-x86_64-rpms',
|
30
30
|
'rhel-7-server-els-satellite-client-6-rpms',
|
31
|
-
'rhel-7-server-els-satellite-6-client-2-rpms',
|
32
|
-
'satellite-6-client-2-for-rhel-8-x86_64-rpms',
|
33
|
-
'satellite-6-client-2-for-rhel-9-x86_64-rpms',
|
34
31
|
];
|
35
32
|
|
36
33
|
const recommendedRepositoriesMisc = [
|
37
|
-
'satellite-capsule-6.
|
38
|
-
'satellite-maintenance-6.
|
39
|
-
'satellite-utils-6.
|
34
|
+
'satellite-capsule-6.16-for-rhel-8-x86_64-rpms',
|
35
|
+
'satellite-maintenance-6.16-for-rhel-8-x86_64-rpms',
|
36
|
+
'satellite-utils-6.16-for-rhel-8-x86_64-rpms',
|
37
|
+
'satellite-utils-6.16-for-rhel-9-x86_64-rpms',
|
38
|
+
'satellite-maintenance-6.16-for-rhel-9-x86_64-rpms',
|
39
|
+
'satellite-capsule-6.16-for-rhel-9-x86_64-rpms',
|
40
40
|
];
|
41
41
|
|
42
42
|
const recommendedRepositorySetLables = recommendedRepositoriesRHEL
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: katello
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.14.
|
4
|
+
version: 4.14.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- N/A
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|