foreman_maintain 1.7.2 → 1.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/definitions/features/pulpcore.rb +3 -1
- data/lib/foreman_maintain/cli/update_command.rb +38 -7
- data/lib/foreman_maintain/update_runner.rb +6 -0
- data/lib/foreman_maintain/utils/service/abstract.rb +4 -0
- data/lib/foreman_maintain/utils/service/remote_db.rb +8 -0
- data/lib/foreman_maintain/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: 9cd7c83e3e9aa5d629b7c65334c4022e8923979a432a917570733afd4d9fef41
|
4
|
+
data.tar.gz: bc2306bdcac1cb11c91f9105902bdac47cf9ad4ddd02a0774d25b035da4a67f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ae072acb083a756c5e4e3eb6b9c87f6f79ebfaa1a70e0385cc0f150078476c63d88c91b443d2b5d9ccb8a0f6c1ec3685f5c26600a147c7ed2f756c0530c6e72
|
7
|
+
data.tar.gz: 76edef0a64cabe97dfb4f515dcc20be20f562418d0e6dbe5b58b27f52bde5821791afe152342c17170ed32d4e377072b35288b5a8c77266b1ff39fe5eaac7044
|
@@ -21,11 +21,13 @@ class Features::Pulpcore < ForemanMaintain::Feature
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def cli(args)
|
24
|
-
parse_json(execute("pulp --format json #{args}"))
|
24
|
+
parse_json(execute!("pulp --format json #{args}"))
|
25
25
|
end
|
26
26
|
|
27
27
|
def running_tasks
|
28
28
|
cli('task list --state-in running --state-in canceling')
|
29
|
+
rescue ForemanMaintain::Error::ExecutionError
|
30
|
+
[]
|
29
31
|
end
|
30
32
|
|
31
33
|
def wait_for_tasks(spinner, timeout_for_tasks_status = TIMEOUT_FOR_TASKS_STATUS)
|
@@ -19,6 +19,27 @@ module ForemanMaintain
|
|
19
19
|
update_runner
|
20
20
|
end
|
21
21
|
|
22
|
+
def try_update
|
23
|
+
if update_runner.available?
|
24
|
+
yield
|
25
|
+
else
|
26
|
+
instance = ForemanMaintain.detector.feature(:instance)
|
27
|
+
msg = <<~BANNER
|
28
|
+
|
29
|
+
This version of #{ForemanMaintain.command_name} only supports #{instance.target_version},
|
30
|
+
but the installed version of #{instance.product_name} is #{instance.current_major_version}.
|
31
|
+
|
32
|
+
Therefore the update command is not available right now.
|
33
|
+
|
34
|
+
Please install a version of #{ForemanMaintain.command_name} that supports #{instance.current_major_version}
|
35
|
+
or perform an upgrade to #{instance.target_version} using the upgrade command.
|
36
|
+
BANNER
|
37
|
+
|
38
|
+
puts msg
|
39
|
+
ForemanMaintain::UpdateRunner::WARNING_EXIT_CODE
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
22
43
|
subcommand 'check', 'Run pre-update checks before updating' do
|
23
44
|
interactive_option
|
24
45
|
disable_self_update_option
|
@@ -26,9 +47,14 @@ module ForemanMaintain
|
|
26
47
|
def execute
|
27
48
|
ForemanMaintain.validate_downstream_packages
|
28
49
|
ForemanMaintain.perform_self_upgrade unless disable_self_update?
|
29
|
-
|
30
|
-
|
31
|
-
|
50
|
+
|
51
|
+
exit_code = try_update do
|
52
|
+
runner = update_runner
|
53
|
+
runner.run_phase(:pre_update_checks)
|
54
|
+
runner.exit_code
|
55
|
+
end
|
56
|
+
|
57
|
+
exit exit_code
|
32
58
|
end
|
33
59
|
end
|
34
60
|
|
@@ -39,10 +65,15 @@ module ForemanMaintain
|
|
39
65
|
def execute
|
40
66
|
ForemanMaintain.validate_downstream_packages
|
41
67
|
ForemanMaintain.perform_self_upgrade unless disable_self_update?
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
68
|
+
|
69
|
+
exit_code = try_update do
|
70
|
+
runner = update_runner
|
71
|
+
runner.run
|
72
|
+
runner.save
|
73
|
+
runner.exit_code
|
74
|
+
end
|
75
|
+
|
76
|
+
exit exit_code
|
46
77
|
end
|
47
78
|
end
|
48
79
|
end
|
@@ -18,6 +18,12 @@ module ForemanMaintain
|
|
18
18
|
self.phase = :pre_update_checks
|
19
19
|
end
|
20
20
|
|
21
|
+
def available?
|
22
|
+
condition = { :tags => [:update_scenario, :pre_update_checks] }
|
23
|
+
matching_scenarios = find_scenarios(condition)
|
24
|
+
!matching_scenarios.empty?
|
25
|
+
end
|
26
|
+
|
21
27
|
def find_scenario(phase)
|
22
28
|
return @scenario_cache[phase] if @scenario_cache.key?(phase)
|
23
29
|
|
@@ -38,6 +38,14 @@ module ForemanMaintain::Utils
|
|
38
38
|
[0, db_status.last]
|
39
39
|
end
|
40
40
|
|
41
|
+
def restart
|
42
|
+
command_name = ForemanMaintain.command_name
|
43
|
+
db_status(<<~MSG
|
44
|
+
Remote databases are not managed by #{command_name} and therefore was not restarted.
|
45
|
+
MSG
|
46
|
+
)
|
47
|
+
end
|
48
|
+
|
41
49
|
def running?
|
42
50
|
status.first == 0
|
43
51
|
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.7.
|
4
|
+
version: 1.7.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: 2024-
|
11
|
+
date: 2024-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clamp
|