Skip to content

Commit

Permalink
Add final upgrade step to check if reboot needed
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Oct 6, 2023
1 parent 249ce77 commit 80f3c77
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions definitions/procedures/packages/check_for_reboot.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module Procedures::Packages
class CheckForReboot < ForemanMaintain::Procedure
metadata do
description 'Check if system needs reboot'
end

def run
status, output = execute_with_status('dnf needs-restarting --reboothint')
puts output
rescue ForemanMaintain::Error::ExecutionError => e
set_status(:warning, e.message)
end
end
end
1 change: 1 addition & 0 deletions definitions/scenarios/upgrade_to_capsule_6_15.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class PostUpgradeChecks < Abstract
def compose
add_steps(find_checks(:default))
add_steps(find_checks(:post_upgrade))
add_step(Procedures::Packages::CheckForReboot)
end
end
end
1 change: 1 addition & 0 deletions definitions/scenarios/upgrade_to_capsule_6_15_z.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class PostUpgradeChecks < Abstract
def compose
add_steps(find_checks(:default))
add_steps(find_checks(:post_upgrade))
add_step(Procedures::Packages::CheckForReboot)
end
end
end
1 change: 1 addition & 0 deletions definitions/scenarios/upgrade_to_satellite_6_15.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class PostUpgradeChecks < Abstract
def compose
add_steps(find_checks(:default))
add_steps(find_checks(:post_upgrade))
add_step(Procedures::Packages::CheckForReboot)
end
end
end
1 change: 1 addition & 0 deletions definitions/scenarios/upgrade_to_satellite_6_15_z.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class PostUpgradeChecks < Abstract
def compose
add_steps(find_checks(:default))
add_steps(find_checks(:post_upgrade))
add_step(Procedures::Packages::CheckForReboot)
end
end
end

0 comments on commit 80f3c77

Please sign in to comment.