katello 3.18.2 → 3.18.2.1
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/lib/actions/katello/repository/sync.rb +5 -1
- data/app/lib/katello/util/pulpcore_content_filters.rb +1 -1
- data/app/models/katello/host/content_facet.rb +9 -31
- data/app/models/katello/ping.rb +35 -15
- data/app/services/katello/pulp3/migration_switchover.rb +2 -0
- data/app/services/katello/pulp3/rpm.rb +5 -1
- data/lib/katello/tasks/pulp3_migration.rake +5 -1
- data/lib/katello/version.rb +1 -1
- 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: 9c5ad1aaf8a0bb032cc1ffd42c4c070c77cc538044396af1cd40db8d00132e58
|
4
|
+
data.tar.gz: fd418dbd20507da2ca47e937df543ccf1f5a2c8d254f17623aec03f0d5d2767b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b21464bd7f2341093cb31c47a6ee1792d508b8d16f6c9f47db4e8cffb3bc737f02aa1150e50cc05352c668db37eadc5fe708cd0d2705010fbd0072f46b887877
|
7
|
+
data.tar.gz: b67b69add02fae0357308a8301ac689814f2e32d835b5270c421d94cf46f6068b6398cd18cbb7da55913106deac0be816668939c605e7bf20d0a671740039402
|
@@ -72,7 +72,11 @@ module Actions
|
|
72
72
|
end
|
73
73
|
plan_self(:id => repo.id, :sync_result => output, :skip_metadata_check => skip_metadata_check, :validate_contents => validate_contents,
|
74
74
|
:contents_changed => contents_changed)
|
75
|
-
|
75
|
+
|
76
|
+
if generate_applicability && !SETTINGS[:katello][:katello_applicability]
|
77
|
+
plan_action(Katello::Repository::ImportApplicability, :repo_id => repo.id, :contents_changed => contents_changed)
|
78
|
+
end
|
79
|
+
|
76
80
|
plan_action(Katello::Repository::SyncHook, :id => repo.id)
|
77
81
|
end
|
78
82
|
end
|
@@ -8,7 +8,7 @@ module Katello
|
|
8
8
|
def filter_package_groups_by_pulp_href(package_groups, package_pulp_hrefs)
|
9
9
|
rpms = Katello::Rpm.where(:pulp_id => package_pulp_hrefs)
|
10
10
|
package_groups.reject do |package_group|
|
11
|
-
(package_group.package_names
|
11
|
+
(package_group.package_names - rpms.pluck(:name)).any?
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -31,43 +31,21 @@ module Katello
|
|
31
31
|
validates :host, :presence => true, :allow_blank => false
|
32
32
|
validates_with Validators::ContentViewEnvironmentValidator
|
33
33
|
|
34
|
-
def bindable_types
|
35
|
-
[
|
36
|
-
{
|
37
|
-
type: Repository::DEB_TYPE,
|
38
|
-
matcher: '/pulp/deb/',
|
39
|
-
paths: []
|
40
|
-
},
|
41
|
-
{
|
42
|
-
type: Repository::YUM_TYPE,
|
43
|
-
matcher: '/pulp/repos/',
|
44
|
-
paths: []
|
45
|
-
}
|
46
|
-
]
|
47
|
-
end
|
48
|
-
|
49
34
|
def update_repositories_by_paths(paths)
|
50
|
-
|
35
|
+
prefixes = %w(/pulp/deb/ /pulp/repos/ /pulp/content/)
|
51
36
|
relative_paths = []
|
52
37
|
|
53
|
-
# paths == ["/pulp/repos/Default_Organization/Library/custom/Test_product/test2"
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
if absolute_path.starts_with?(supported[:matcher])
|
60
|
-
supported[:paths] << relative_path
|
61
|
-
break
|
62
|
-
end
|
38
|
+
# paths == ["/pulp/repos/Default_Organization/Library/custom/Test_product/test2"]
|
39
|
+
paths.each do |path|
|
40
|
+
if (prefix = prefixes.find { |pre| path.start_with?(pre) })
|
41
|
+
relative_paths << path.gsub(prefix, '')
|
42
|
+
else
|
43
|
+
Rails.logger.warn("System #{self.host.name} (#{self.host.id}) requested binding to repo with unknown prefix. #{path}")
|
63
44
|
end
|
64
45
|
end
|
65
46
|
|
66
|
-
repos =
|
67
|
-
|
68
|
-
relative_paths -= repos.pluck(:relative_path) # remove relative paths that match our repos
|
69
|
-
repos
|
70
|
-
end
|
47
|
+
repos = Repository.where(relative_path: relative_paths)
|
48
|
+
relative_paths -= repos.pluck(:relative_path) # remove relative paths that match our repos
|
71
49
|
|
72
50
|
# Any leftover relative paths do not match the repos we've just retrieved from the db,
|
73
51
|
# so we should log warnings about them.
|
data/app/models/katello/ping.rb
CHANGED
@@ -23,25 +23,18 @@ module Katello
|
|
23
23
|
services
|
24
24
|
end
|
25
25
|
|
26
|
-
# Calls "status" services in all backend engines.
|
27
26
|
def ping(services: nil, capsule_id: nil)
|
28
|
-
services
|
29
|
-
|
30
|
-
services.each { |service| result[service] = {} }
|
27
|
+
ping_services_for_capsule(services, capsule_id)
|
28
|
+
end
|
31
29
|
|
32
|
-
|
33
|
-
|
34
|
-
ping_candlepin_without_auth(result[:candlepin]) if result.include?(:candlepin)
|
30
|
+
def ping!(services: nil, capsule_id: nil)
|
31
|
+
result = ping_services_for_capsule(services, capsule_id)
|
35
32
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
ping_candlepin_events(result[:candlepin_events]) if result.include?(:candlepin_events)
|
33
|
+
if result[:status] != OK_RETURN_CODE
|
34
|
+
failed_names = failed_services(result).keys
|
35
|
+
fail("The following services have not been started or are reporting errors: #{failed_names.join(', ')}")
|
36
|
+
end
|
41
37
|
|
42
|
-
# set overall status result code
|
43
|
-
result = {:services => result}
|
44
|
-
result[:status] = result[:services].each_value.any? { |v| v[:status] == FAIL_RETURN_CODE } ? FAIL_RETURN_CODE : OK_RETURN_CODE
|
45
38
|
result
|
46
39
|
end
|
47
40
|
|
@@ -221,6 +214,33 @@ module Katello
|
|
221
214
|
|
222
215
|
private
|
223
216
|
|
217
|
+
def failed_services(result)
|
218
|
+
result[:services].reject do |_name, details|
|
219
|
+
details[:status] != OK_RETURN_CODE
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
def ping_services_for_capsule(services, capsule_id)
|
224
|
+
services ||= self.services(capsule_id)
|
225
|
+
result = {}
|
226
|
+
services.each { |service| result[service] = {} }
|
227
|
+
|
228
|
+
ping_pulp3_without_auth(result[:pulp3], capsule_id) if result.include?(:pulp3)
|
229
|
+
ping_pulp_without_auth(result[:pulp], capsule_id) if result.include?(:pulp)
|
230
|
+
ping_candlepin_without_auth(result[:candlepin]) if result.include?(:candlepin)
|
231
|
+
|
232
|
+
ping_pulp_with_auth(result[:pulp_auth], result[:pulp][:status]) if result.include?(:pulp_auth)
|
233
|
+
ping_candlepin_with_auth(result[:candlepin_auth]) if result.include?(:candlepin_auth)
|
234
|
+
ping_foreman_tasks(result[:foreman_tasks]) if result.include?(:foreman_tasks)
|
235
|
+
ping_katello_events(result[:katello_events]) if result.include?(:katello_events)
|
236
|
+
ping_candlepin_events(result[:candlepin_events]) if result.include?(:candlepin_events)
|
237
|
+
|
238
|
+
# set overall status result code
|
239
|
+
result = {:services => result}
|
240
|
+
result[:status] = result[:services].each_value.any? { |v| v[:status] == FAIL_RETURN_CODE } ? FAIL_RETURN_CODE : OK_RETURN_CODE
|
241
|
+
result
|
242
|
+
end
|
243
|
+
|
224
244
|
def fetch_proxy(capsule_id)
|
225
245
|
capsule_id ? SmartProxy.unscoped.find(capsule_id) : SmartProxy.pulp_primary
|
226
246
|
end
|
@@ -111,6 +111,8 @@ module Katello
|
|
111
111
|
content_types.each do |content_type|
|
112
112
|
if Migration::CORRUPTABLE_CONTENT_TYPES.include?(content_type.model_class)
|
113
113
|
content_type.model_class.ignored_missing_migrated_content.destroy_all
|
114
|
+
elsif content_type.model_class == Katello::Erratum
|
115
|
+
Katello::RepositoryErratum.where(:erratum_pulp3_href => nil).delete_all
|
114
116
|
else
|
115
117
|
content_type.model_class.unmigrated_content.destroy_all
|
116
118
|
end
|
@@ -111,6 +111,10 @@ module Katello
|
|
111
111
|
backend_data['rpm_license']
|
112
112
|
end
|
113
113
|
|
114
|
+
def parse_filename(path)
|
115
|
+
File.split(path).last unless path.blank?
|
116
|
+
end
|
117
|
+
|
114
118
|
def update_model(model)
|
115
119
|
custom_json = {}
|
116
120
|
custom_json['modular'] = backend_data['is_modular']
|
@@ -119,7 +123,7 @@ module Katello
|
|
119
123
|
each { |field| custom_json[field] = backend_data[field] }
|
120
124
|
custom_json['release_sortable'] = Util::Package.sortable_version(backend_data['release'])
|
121
125
|
custom_json['version_sortable'] = Util::Package.sortable_version(backend_data['version'])
|
122
|
-
custom_json['filename'] = backend_data['location_href']
|
126
|
+
custom_json['filename'] = parse_filename(backend_data['location_href']) #location_href is the relative path of the rpm in the upstream repo
|
123
127
|
custom_json['checksum'] = backend_data['pkgId']
|
124
128
|
custom_json['sourcerpm'] = backend_data['rpm_sourcerpm']
|
125
129
|
model.assign_attributes(custom_json)
|
@@ -1,6 +1,9 @@
|
|
1
1
|
namespace :katello do
|
2
2
|
desc "Runs a Pulp 2 to 3 Content Migration for supported types. May be run multiple times. Use wait=false to immediately return with a task url."
|
3
|
-
task :pulp3_migration => ["dynflow:client"
|
3
|
+
task :pulp3_migration => ["dynflow:client"] do
|
4
|
+
services = [:candlepin, :foreman_tasks, :pulp3, :pulp, :pulp_auth]
|
5
|
+
Katello::Ping.ping!(services: services)
|
6
|
+
|
4
7
|
puts "Starting task."
|
5
8
|
SmartProxy.pulp_primary.refresh
|
6
9
|
|
@@ -8,6 +11,7 @@ namespace :katello do
|
|
8
11
|
wait = ::Foreman::Cast.to_bool(ENV['wait'] || 'true')
|
9
12
|
preserve_output = ::Foreman::Cast.to_bool(ENV['preserve_output'])
|
10
13
|
|
14
|
+
User.current = User.anonymous_api_admin
|
11
15
|
task = ForemanTasks.async_task(Actions::Pulp3::ContentMigration, SmartProxy.pulp_primary, reimport_all: reimport_all)
|
12
16
|
|
13
17
|
if wait
|
data/lib/katello/version.rb
CHANGED
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: 3.18.2
|
4
|
+
version: 3.18.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- N/A
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|