-
-
Notifications
You must be signed in to change notification settings - Fork 402
[WIP] Add RebootRequired fact for detecting system reboot needs #1310
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
base: 3.x
Are you sure you want to change the base?
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.
not sure if it is the best way to do it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
"reboot_required" | ||
], | ||
"fact": true, | ||
"setup": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this key does anything?
def command(self) -> str: | ||
return """ | ||
# Get OS type | ||
OS_TYPE=$(uname -s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, the problem of facts being unable to call each other. Unfortunately I think this is the best way we can currently do this.
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.