foreman_maintain 1.3.3 → 1.3.4
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/features/candlepin_database.rb +0 -22
- data/definitions/features/instance.rb +8 -0
- data/definitions/scenarios/restore.rb +3 -1
- data/lib/foreman_maintain/reporter/cli_reporter.rb +5 -5
- data/lib/foreman_maintain/utils/backup.rb +8 -0
- data/lib/foreman_maintain/version.rb +1 -1
- metadata +2 -3
- data/definitions/checks/candlepin/validate_db.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 467793fe18d5403460cbb877a9b42e8b6c9f82aaf3e876988c444baf0d472e17
|
4
|
+
data.tar.gz: f963b22148f4e08f0daee4a2af1fd479bc655aff1ec6b14c41fe249b51d4e188
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfce108a55c8f37f82da2b07081a3362f47267a95926e105c74dfc6602eb48ee424603026c9aec32d26e263a1e84deab68a7008953bcfece418029533d14376c
|
7
|
+
data.tar.gz: 8e8f0b94739d7e03f1ca3e8f197013780c030ab46a9d5c6f81c4ee7d2169d37c5d9a21fdd779544c947abb87b8346f67b2b9de7ebe2707c94b6afc4ec9e7298b
|
@@ -22,26 +22,12 @@ class Features::CandlepinDatabase < ForemanMaintain::Feature
|
|
22
22
|
@configuration || load_configuration
|
23
23
|
end
|
24
24
|
|
25
|
-
def validate_available_in_cpdb?
|
26
|
-
check_option_using_cpdb_help('validate')
|
27
|
-
end
|
28
|
-
|
29
25
|
def check_option_using_cpdb_help(option_name, parent_cmd = '')
|
30
26
|
parent_cmd = '/usr/share/candlepin/cpdb' if parent_cmd.empty?
|
31
27
|
help_cmd = "#{parent_cmd} --help | grep -c '\\-\\-#{option_name}'"
|
32
28
|
execute?(help_cmd)
|
33
29
|
end
|
34
30
|
|
35
|
-
def execute_cpdb_validate_cmd
|
36
|
-
main_cmd = cpdb_validate_cmd
|
37
|
-
return [true, nil] if main_cmd.empty?
|
38
|
-
main_cmd += format_shell_args(
|
39
|
-
'-u' => configuration['username'], '-p' => configuration[%(password)]
|
40
|
-
)
|
41
|
-
main_cmd += format_shell_args(extend_with_db_options)
|
42
|
-
execute_with_status(main_cmd, :hidden_patterns => [configuration['password']])
|
43
|
-
end
|
44
|
-
|
45
31
|
def env_content_ids_with_null_content
|
46
32
|
sql = <<-SQL
|
47
33
|
SELECT ec.id
|
@@ -87,12 +73,4 @@ class Features::CandlepinDatabase < ForemanMaintain::Feature
|
|
87
73
|
output = /#{key_name}=([^&]*)?/.match(query_string)
|
88
74
|
output[1] if output
|
89
75
|
end
|
90
|
-
|
91
|
-
def cpdb_validate_cmd
|
92
|
-
return '' unless check_option_using_cpdb_help('validate')
|
93
|
-
cmd = '/usr/share/candlepin/cpdb --validate'
|
94
|
-
return cmd unless check_option_using_cpdb_help('verbose', cmd)
|
95
|
-
cmd += ' --verbose'
|
96
|
-
cmd
|
97
|
-
end
|
98
76
|
end
|
@@ -28,6 +28,14 @@ class Features::Instance < ForemanMaintain::Feature
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
+
def project_support_entity
|
32
|
+
if downstream
|
33
|
+
'Red Hat Technical Support'
|
34
|
+
else
|
35
|
+
'Foreman Community Support'
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
31
39
|
def database_remote?(feature)
|
32
40
|
!!feature(feature) && !feature(feature).local?
|
33
41
|
end
|
@@ -45,7 +45,9 @@ module ForemanMaintain::Scenarios
|
|
45
45
|
add_step(Procedures::Service::Stop.new(:only => ['postgresql']))
|
46
46
|
end
|
47
47
|
|
48
|
-
if feature(:instance).postgresql_local? &&
|
48
|
+
if feature(:instance).postgresql_local? &&
|
49
|
+
!backup.online_backup? &&
|
50
|
+
backup.different_source_os?
|
49
51
|
add_step_with_context(Procedures::Restore::ReindexDatabases)
|
50
52
|
end
|
51
53
|
|
@@ -330,20 +330,20 @@ module ForemanMaintain
|
|
330
330
|
whitelist_labels = steps_to_whitelist.map(&:label_dashed).join(',')
|
331
331
|
unless whitelist_labels.empty?
|
332
332
|
recommend << if scenario.detector.feature(:instance).downstream
|
333
|
-
format(<<-MESSAGE.strip_heredoc
|
333
|
+
format(<<-MESSAGE.strip_heredoc)
|
334
334
|
Resolve the failed steps and rerun the command.
|
335
335
|
|
336
336
|
If the situation persists and, you are unclear what to do next,
|
337
|
-
contact
|
337
|
+
contact #{scenario.detector.feature(:instance).project_support_entity}.
|
338
338
|
|
339
339
|
In case the failures are false positives, use
|
340
|
-
--whitelist="
|
340
|
+
--whitelist="#{whitelist_labels}"
|
341
341
|
MESSAGE
|
342
342
|
else
|
343
|
-
format(<<-MESSAGE.strip_heredoc
|
343
|
+
format(<<-MESSAGE.strip_heredoc)
|
344
344
|
Resolve the failed steps and rerun the command.
|
345
345
|
In case the failures are false positives, use
|
346
|
-
--whitelist="
|
346
|
+
--whitelist="#{whitelist_labels}"
|
347
347
|
MESSAGE
|
348
348
|
end
|
349
349
|
end
|
@@ -265,6 +265,14 @@ module ForemanMaintain
|
|
265
265
|
def with_qpidd?
|
266
266
|
installed_rpms.any? { |rpm| rpm.start_with?('qpid-cpp-server-') }
|
267
267
|
end
|
268
|
+
|
269
|
+
def source_os_version
|
270
|
+
metadata.fetch('os_version', 'unknown')
|
271
|
+
end
|
272
|
+
|
273
|
+
def different_source_os?
|
274
|
+
source_os_version != "#{os_name} #{os_version}"
|
275
|
+
end
|
268
276
|
end
|
269
277
|
end
|
270
278
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_maintain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Nečas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clamp
|
@@ -160,7 +160,6 @@ files:
|
|
160
160
|
- definitions/checks/backup/certs_tar_exist.rb
|
161
161
|
- definitions/checks/backup/directory_ready.rb
|
162
162
|
- definitions/checks/candlepin/db_up.rb
|
163
|
-
- definitions/checks/candlepin/validate_db.rb
|
164
163
|
- definitions/checks/check_for_newer_packages.rb
|
165
164
|
- definitions/checks/check_hotfix_installed.rb
|
166
165
|
- definitions/checks/check_tmout.rb
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module Checks::Candlepin
|
2
|
-
class ValidateDb < ForemanMaintain::Check
|
3
|
-
metadata do
|
4
|
-
description 'Check to validate candlepin database'
|
5
|
-
tags :pre_upgrade
|
6
|
-
|
7
|
-
confine do
|
8
|
-
feature(:candlepin_database)&.validate_available_in_cpdb?
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
def run
|
13
|
-
result, result_msg = feature(:candlepin_database).execute_cpdb_validate_cmd
|
14
|
-
assert(result == 0, result_msg)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|