foreman_maintain 1.13.7 → 1.14.0
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/definitions/checks/foreman/check_corrupted_roles.rb +1 -3
- data/definitions/features/iop.rb +1 -0
- data/definitions/procedures/foreman/fix_corrupted_roles.rb +6 -7
- data/definitions/scenarios/foreman_upgrade.rb +0 -1
- data/definitions/scenarios/satellite_upgrade.rb +0 -2
- data/definitions/scenarios/update.rb +0 -1
- data/lib/foreman_maintain/version.rb +1 -1
- metadata +6 -7
- data/definitions/checks/check_subscription_manager_release.rb +0 -41
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 580f9ed6daf35b7d33e6882ed898e6f9e157cf2c1624d41d00b59307f946100f
|
|
4
|
+
data.tar.gz: ee891a1e0626efd104d723c5e1238aba4646e98b2ba3f2f4c1f6ad18fa6b5360
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1061e9ed5bf86aeb1e06f7443be45ba4537f09f7c098becfca7d525494b7bd8dcbe48fb0b3d8a1fd93e2bd902d46d721101006090f02cafd9c6bd6b25cf0631a
|
|
7
|
+
data.tar.gz: a4901ffda5a1ed71dabf18efd1910a4505713b946400bec86f76a9cd5e4338357afec55b41f758fd2a7ccc2f3c94c55e0b0cdde4fc639fa3a6dd5a9633f933f0
|
|
@@ -32,7 +32,6 @@ module Checks
|
|
|
32
32
|
filters.role_id,
|
|
33
33
|
filters.search,
|
|
34
34
|
filters.taxonomy_search,
|
|
35
|
-
filters.override,
|
|
36
35
|
filterings.id AS filtering_id,
|
|
37
36
|
permissions.id AS permission_id,
|
|
38
37
|
permissions.name AS permission_name,
|
|
@@ -52,8 +51,7 @@ module Checks
|
|
|
52
51
|
first.permission_name,
|
|
53
52
|
first.resource_type,
|
|
54
53
|
first.search,
|
|
55
|
-
first.taxonomy_search
|
|
56
|
-
first.override
|
|
54
|
+
first.taxonomy_search
|
|
57
55
|
FROM (#{subquery}) first JOIN (#{subquery}) second
|
|
58
56
|
ON first.filter_id = second.filter_id AND
|
|
59
57
|
((first.resource_type IS NOT NULL AND second.resource_type IS NULL)
|
data/definitions/features/iop.rb
CHANGED
|
@@ -34,8 +34,7 @@ module Procedures::Foreman
|
|
|
34
34
|
def update_records(set)
|
|
35
35
|
new_filter = create_filter set.first['role_id'],
|
|
36
36
|
set.first['search'],
|
|
37
|
-
set.first['taxonomy_search']
|
|
38
|
-
set.first['override']
|
|
37
|
+
set.first['taxonomy_search']
|
|
39
38
|
set.each do |item|
|
|
40
39
|
destroy_filtering item
|
|
41
40
|
next if !new_filter || new_filter.empty?
|
|
@@ -43,9 +42,9 @@ module Procedures::Foreman
|
|
|
43
42
|
end
|
|
44
43
|
end
|
|
45
44
|
|
|
46
|
-
def create_filter(role_id, search, taxonomy_search
|
|
45
|
+
def create_filter(role_id, search, taxonomy_search)
|
|
47
46
|
feature(:foreman_database).query(
|
|
48
|
-
create_filter_query(search, role_id, taxonomy_search
|
|
47
|
+
create_filter_query(search, role_id, taxonomy_search)
|
|
49
48
|
).first
|
|
50
49
|
end
|
|
51
50
|
|
|
@@ -53,11 +52,11 @@ module Procedures::Foreman
|
|
|
53
52
|
value ? "'#{value}'" : 'NULL'
|
|
54
53
|
end
|
|
55
54
|
|
|
56
|
-
def create_filter_query(search, role_id, taxonomy_search
|
|
55
|
+
def create_filter_query(search, role_id, taxonomy_search)
|
|
57
56
|
<<-SQL
|
|
58
57
|
WITH rows AS (
|
|
59
|
-
INSERT INTO filters (search, role_id, taxonomy_search,
|
|
60
|
-
VALUES (#{escape_val(search)}, #{role_id}, #{escape_val(taxonomy_search)}, '#{
|
|
58
|
+
INSERT INTO filters (search, role_id, taxonomy_search, created_at, updated_at)
|
|
59
|
+
VALUES (#{escape_val(search)}, #{role_id}, #{escape_val(taxonomy_search)}, '#{Time.now}', '#{Time.now}')
|
|
61
60
|
RETURNING id
|
|
62
61
|
)
|
|
63
62
|
SELECT id
|
|
@@ -35,7 +35,6 @@ module Scenarios::Satellite
|
|
|
35
35
|
Checks::SystemRegistration,
|
|
36
36
|
Checks::CheckHotfixInstalled,
|
|
37
37
|
Checks::CheckTmout,
|
|
38
|
-
Checks::CheckSubscriptionManagerRelease,
|
|
39
38
|
Checks::CheckUpstreamRepository,
|
|
40
39
|
Checks::Container::PodmanLogin, # if downstream, connected, containers used
|
|
41
40
|
Checks::Disk::AvailableSpace,
|
|
@@ -116,7 +115,6 @@ module Scenarios::Satellite
|
|
|
116
115
|
add_steps(
|
|
117
116
|
Procedures::RefreshFeatures,
|
|
118
117
|
Procedures::Service::Start,
|
|
119
|
-
Procedures::Pulpcore::RpmDatarepair,
|
|
120
118
|
Procedures::Crond::Start,
|
|
121
119
|
Procedures::Timer::Start,
|
|
122
120
|
Procedures::SyncPlans::Enable,
|
|
@@ -33,7 +33,6 @@ module Scenarios::Update
|
|
|
33
33
|
Checks::SystemRegistration,
|
|
34
34
|
Checks::CheckHotfixInstalled,
|
|
35
35
|
Checks::CheckTmout,
|
|
36
|
-
Checks::CheckSubscriptionManagerRelease,
|
|
37
36
|
Checks::CheckIpv6Disable,
|
|
38
37
|
Checks::CheckUpstreamRepository,
|
|
39
38
|
Checks::Container::PodmanLogin, # if downstream, connected, containers used
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foreman_maintain
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.14.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ivan Nečas
|
|
@@ -55,16 +55,16 @@ dependencies:
|
|
|
55
55
|
name: minitest
|
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
|
57
57
|
requirements:
|
|
58
|
-
- - "
|
|
58
|
+
- - ">="
|
|
59
59
|
- !ruby/object:Gem::Version
|
|
60
|
-
version: '
|
|
60
|
+
version: '0'
|
|
61
61
|
type: :development
|
|
62
62
|
prerelease: false
|
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
64
64
|
requirements:
|
|
65
|
-
- - "
|
|
65
|
+
- - ">="
|
|
66
66
|
- !ruby/object:Gem::Version
|
|
67
|
-
version: '
|
|
67
|
+
version: '0'
|
|
68
68
|
- !ruby/object:Gem::Dependency
|
|
69
69
|
name: minitest-reporters
|
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -161,7 +161,6 @@ files:
|
|
|
161
161
|
- definitions/checks/check_hotfix_installed.rb
|
|
162
162
|
- definitions/checks/check_ipv6_disable.rb
|
|
163
163
|
- definitions/checks/check_sha1_certificate_authority.rb
|
|
164
|
-
- definitions/checks/check_subscription_manager_release.rb
|
|
165
164
|
- definitions/checks/check_tmout.rb
|
|
166
165
|
- definitions/checks/container/podman_login.rb
|
|
167
166
|
- definitions/checks/disk/available_space.rb
|
|
@@ -488,7 +487,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
488
487
|
- !ruby/object:Gem::Version
|
|
489
488
|
version: '0'
|
|
490
489
|
requirements: []
|
|
491
|
-
rubygems_version:
|
|
490
|
+
rubygems_version: 3.6.9
|
|
492
491
|
specification_version: 4
|
|
493
492
|
summary: Foreman maintenance tool belt
|
|
494
493
|
test_files: []
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
class Checks::CheckSubscriptionManagerRelease < ForemanMaintain::Check
|
|
2
|
-
metadata do
|
|
3
|
-
label :check_subscription_manager_release
|
|
4
|
-
description 'Check if subscription-manager release is not set to a minor version'
|
|
5
|
-
|
|
6
|
-
confine do
|
|
7
|
-
feature(:instance).downstream
|
|
8
|
-
end
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def run
|
|
12
|
-
status, output = execute_with_status('LC_ALL=C subscription-manager release --show')
|
|
13
|
-
|
|
14
|
-
# If command fails (subscription-manager not installed or system not registered), pass the check
|
|
15
|
-
return if status != 0
|
|
16
|
-
|
|
17
|
-
assert(valid_release?(output), error_message(output))
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
private
|
|
21
|
-
|
|
22
|
-
def valid_release?(output)
|
|
23
|
-
# Valid formats: "Release not set" or "Release: X" where X is a major version without dots
|
|
24
|
-
return true if output == 'Release not set'
|
|
25
|
-
return true if /^Release:\s+\d+$/.match?(output)
|
|
26
|
-
|
|
27
|
-
false
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def extract_release(output)
|
|
31
|
-
match = output.match(/^Release:\s+(.+)$/)
|
|
32
|
-
match ? match[1] : output
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def error_message(output)
|
|
36
|
-
subman_release = extract_release(output)
|
|
37
|
-
"Your system is configured to use RHEL #{subman_release}, but Satellite is only "\
|
|
38
|
-
"supported on the latest RHEL. Please unset the release in subscription-manager by "\
|
|
39
|
-
"calling `subscription-manager release --unset`."
|
|
40
|
-
end
|
|
41
|
-
end
|