foreman_maintain 1.14.0 → 1.14.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 580f9ed6daf35b7d33e6882ed898e6f9e157cf2c1624d41d00b59307f946100f
4
- data.tar.gz: ee891a1e0626efd104d723c5e1238aba4646e98b2ba3f2f4c1f6ad18fa6b5360
3
+ metadata.gz: a44c3749923c8c50ee979b2692286e568ad55fd213efb96b06c3f662ebebfb96
4
+ data.tar.gz: 5248121eceec015f2be5bc9e96c5b93a4042e34193f223781f87c6b26e306d96
5
5
  SHA512:
6
- metadata.gz: 1061e9ed5bf86aeb1e06f7443be45ba4537f09f7c098becfca7d525494b7bd8dcbe48fb0b3d8a1fd93e2bd902d46d721101006090f02cafd9c6bd6b25cf0631a
7
- data.tar.gz: a4901ffda5a1ed71dabf18efd1910a4505713b946400bec86f76a9cd5e4338357afec55b41f758fd2a7ccc2f3c94c55e0b0cdde4fc639fa3a6dd5a9633f933f0
6
+ metadata.gz: 3e54601d8b7f4a71f31c3190e6b5db6e3afa4bfa75d44a9f0a7b5c29a847b91da7f006cacbf6fb678688501bd62f8701287882ba32c87e0bccb6675b2f04bc23
7
+ data.tar.gz: 3da19df1167b93f7ea64b7925d7ca21b305a67badb20abbd7a8318b64d9a4187ffee7f985e817f71bd8f063432353e89fb9a75ab59abb89e0d171b8bb1d54b83
@@ -0,0 +1,41 @@
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
@@ -35,6 +35,7 @@ module Scenarios::Satellite
35
35
  Checks::SystemRegistration,
36
36
  Checks::CheckHotfixInstalled,
37
37
  Checks::CheckTmout,
38
+ Checks::CheckSubscriptionManagerRelease,
38
39
  Checks::CheckUpstreamRepository,
39
40
  Checks::Container::PodmanLogin, # if downstream, connected, containers used
40
41
  Checks::Disk::AvailableSpace,
@@ -33,6 +33,7 @@ module Scenarios::Update
33
33
  Checks::SystemRegistration,
34
34
  Checks::CheckHotfixInstalled,
35
35
  Checks::CheckTmout,
36
+ Checks::CheckSubscriptionManagerRelease,
36
37
  Checks::CheckIpv6Disable,
37
38
  Checks::CheckUpstreamRepository,
38
39
  Checks::Container::PodmanLogin, # if downstream, connected, containers used
@@ -1,3 +1,3 @@
1
1
  module ForemanMaintain
2
- VERSION = '1.14.0'.freeze
2
+ VERSION = '1.14.1'.freeze
3
3
  end
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.14.0
4
+ version: 1.14.1
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: '0'
60
+ version: '5.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: '0'
67
+ version: '5.0'
68
68
  - !ruby/object:Gem::Dependency
69
69
  name: minitest-reporters
70
70
  requirement: !ruby/object:Gem::Requirement
@@ -161,6 +161,7 @@ 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
164
165
  - definitions/checks/check_tmout.rb
165
166
  - definitions/checks/container/podman_login.rb
166
167
  - definitions/checks/disk/available_space.rb
@@ -487,7 +488,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
487
488
  - !ruby/object:Gem::Version
488
489
  version: '0'
489
490
  requirements: []
490
- rubygems_version: 3.6.9
491
+ rubygems_version: 4.0.3
491
492
  specification_version: 4
492
493
  summary: Foreman maintenance tool belt
493
494
  test_files: []