Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add final upgrade step to check if reboot needed #773

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions definitions/procedures/packages/check_for_reboot.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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')
if status == 1
set_status(:warning, output)
else
set_status(:success, output)
end
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why isn't the step just tagged with post_upgrade?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want it to be the final step so the user sees it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hence my question above:

My only concern is whether this is too "hidden" of output for the user and if instead we need more of special post upgrade output (similar to the installer) that clearly articulates any upgrade considerations.

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
Loading