-
Notifications
You must be signed in to change notification settings - Fork 492
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
NAS-128203 / 25.04 / reboot
plugin
#14530
Conversation
FWIW, in the original ticket we thought we need a reason for generic shutdown as well, not only reboot. |
@william-gr this PR is for displaying "this system must be rebooted, here is why", not for requiring a reason to reboot/shutdown, or do I misunderstand something? |
We had a ticket for generic shutdown/reboot reason, if someone goes to the UI and do it manually. I wasn't sure if you were going to address everything in one go, if not, apologies. |
@william-gr that's no problem, I was going to address shutdown/reboot audit in a different PR |
3be5b66
to
e3e148b
Compare
e3e148b
to
8d6a22d
Compare
'timeout': 2, | ||
'connect_timeout': 2, | ||
}) | ||
except Exception: |
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.
You'll need to handle ENOMETHOD a bit more gracefully here since this will always fail on HA upgrade.
if other_node is not None: | ||
for remote_reboot_reason_code, remote_reboot_reason in list(self.remote_reboot_reasons.items()): | ||
if remote_reboot_reason.boot_id is None: | ||
# This reboot reason was added while the remote node was not functional. |
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.
The reason why I used the keyvalue plugin was to avoid double-reboot scenarios like this so I would interpret this new behavior as a regression. Was there a reason why you stopped using keyvalue?
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.
You are correct. I added the persistence for self.remote_reboot_reasons
via keyvalue
plugin.
from middlewared.schema import accepts, Bool, Dict, Int, Patch | ||
from middlewared.service import ConfigService, ValidationError, job, private | ||
|
||
FIPS_REBOOT_CODE = 'FIPS' |
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'd rather create an enum class in the system/reboot_reasons.py
file (or similar) and use that instead of having random global variables in different plugins. This will become important for tools like hactl
.
7605fa8
to
fcf8fee
Compare
Co-authored-by: Caleb St. John <[email protected]>
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.
Be sure and open UI ticket with the new behavior since HA upgrades will be broken in nightlies with these changes.
This PR has been merged and conversations have been locked. |
time 20:00 |
Time tracking added. |
No description provided.