Add RebootRequired fact for detecting system reboot needs#1310
Merged
Fizzadar merged 15 commits intopyinfra-dev:3.xfrom Aug 28, 2025
KalvadTech:reboot_required
Merged
Add RebootRequired fact for detecting system reboot needs#1310Fizzadar merged 15 commits intopyinfra-dev:3.xfrom KalvadTech:reboot_required
Fizzadar merged 15 commits intopyinfra-dev:3.xfrom
KalvadTech:reboot_required
Conversation
Introduces a new fact to check if a system requires a reboot across different Unix-like systems: - Linux: Checks /var/run/reboot-required files and Alpine Linux kernel comparison - FreeBSD: Compares running and installed kernel versions Supports detection methods for Linux and FreeBSD systems with a flexible shell script approach.
Adds comprehensive test cases for the RebootRequired fact across different Unix-like systems: - Alpine Linux kernel version comparison test - Linux standard reboot required file test - FreeBSD kernel version comparison test - Linux no reboot required scenario test These test cases validate the detection logic for various system reboot scenarios.
Refactor the release metadata dictionary comprehension to a single line, removing unnecessary line breaks while preserving the original logic of converting OS release info keys to uppercase.
Collaborator
Author
|
not sure if it is the best way to do it |
Fizzadar
reviewed
Mar 27, 2025
Member
Fizzadar
left a comment
There was a problem hiding this comment.
I think there's some extra test args but otherwise this looks good. The script is somewhat hacky but there's no real alternative with the way facts work today.
Fizzadar
reviewed
Jun 9, 2025
Member
Fizzadar
left a comment
There was a problem hiding this comment.
Two override decorators needed to fix type check, then good to go I think?
Remove unnecessary newlines and fact keys from test JSON files
Member
|
@wowi42 do you mind giving me push access to the branch, I'd like to fix up the styling to get this merged! |
Co-authored-by: Nick Mills-Barrett <nick@fizzadar.com>
Co-authored-by: Nick Mills-Barrett <nick@fizzadar.com>
Collaborator
Author
|
@Fizzadar sorry for the delay. You got access to the branch and I did some patch. We are good to go I think. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces a new fact to check if a system requires a reboot across different Unix-like systems:
Supports detection methods for Linux and FreeBSD systems with a flexible shell script approach.