foreman_maintain 1.7.1 → 1.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/definitions/checks/pulpcore/no_running_tasks.rb +3 -0
- data/definitions/features/pulpcore.rb +5 -0
- data/definitions/procedures/crond/start.rb +1 -1
- data/definitions/procedures/crond/stop.rb +1 -1
- data/definitions/procedures/maintenance_mode/disable_maintenance_mode.rb +1 -1
- data/definitions/procedures/maintenance_mode/enable_maintenance_mode.rb +1 -1
- data/definitions/scenarios/maintenance_mode.rb +6 -2
- data/lib/foreman_maintain/cli/update_command.rb +38 -7
- data/lib/foreman_maintain/update_runner.rb +6 -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: e3e15401e01712537566856184b187a132a0c3db2634955d8688875ba4c2ca01
|
4
|
+
data.tar.gz: 5e0bcafc241cf70f128ebe6fe887b50b83dd265311fec601360f92bbd2760751
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6344eb03b0caec004ebd5920bd7d416535000379361146680af2e1870d28a98816403210bcc8db78dc18be27c2d8559400fbc0c7160f5e8c680923f833b4eb6
|
7
|
+
data.tar.gz: cd87120311bedea2789b1ccf9db5b16ae8b81282eb0d49ac9e053f19b4702328dca9a502e4788898fd47330122dca3014dabf579f02a8e885c24685c72fd619c
|
@@ -6,6 +6,7 @@ class Features::Pulpcore < ForemanMaintain::Feature
|
|
6
6
|
TIMEOUT_FOR_TASKS_STATUS = 300
|
7
7
|
RETRY_INTERVAL_FOR_TASKS_STATE = 10
|
8
8
|
PULP_SETTINGS = '/etc/pulp/settings.py'.freeze
|
9
|
+
PULP_CLI_SETTINGS = '/etc/pulp/cli.toml'.freeze
|
9
10
|
|
10
11
|
metadata do
|
11
12
|
label :pulpcore
|
@@ -15,6 +16,10 @@ class Features::Pulpcore < ForemanMaintain::Feature
|
|
15
16
|
end
|
16
17
|
end
|
17
18
|
|
19
|
+
def cli_available?
|
20
|
+
File.exist?(PULP_CLI_SETTINGS)
|
21
|
+
end
|
22
|
+
|
18
23
|
def cli(args)
|
19
24
|
parse_json(execute("pulp --format json #{args}"))
|
20
25
|
end
|
@@ -8,7 +8,9 @@ module ForemanMaintain::Scenarios
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def compose
|
11
|
-
|
11
|
+
add_step(Procedures::MaintenanceMode::EnableMaintenanceMode)
|
12
|
+
add_step(Procedures::Crond::Stop)
|
13
|
+
add_step(Procedures::SyncPlans::Disable)
|
12
14
|
end
|
13
15
|
end
|
14
16
|
|
@@ -21,7 +23,9 @@ module ForemanMaintain::Scenarios
|
|
21
23
|
end
|
22
24
|
|
23
25
|
def compose
|
24
|
-
|
26
|
+
add_step(Procedures::SyncPlans::Enable)
|
27
|
+
add_step(Procedures::Crond::Start)
|
28
|
+
add_step(Procedures::MaintenanceMode::DisableMaintenanceMode)
|
25
29
|
end
|
26
30
|
end
|
27
31
|
|
@@ -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
|
|
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.3
|
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-08-
|
11
|
+
date: 2024-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clamp
|