feat(power): shutdown_host through HostShutdownMixin, 0.25.0 (NetOrk/netork#2841)
The host's clean shutdown next to reboot_host: /sbin/poweroff as root, detached and two seconds late like the restart, so the exit status comes back before the session drops. A refusal raises RuntimeError with what the host said, plus the sudo password hint where sudo wanted one. poweroff rather than shutdown -h now: systemd links it to systemctl poweroff, sysvinit and BusyBox ship it themselves, while BusyBox has no shutdown and sysvinit's -h may only halt.
This commit is contained in:
1 parent
a8c57a61e4
commit
f876ac4598
5 files changed
+83
-8
No files matched your search
@@ -88,6 +88,7 @@ class TestTheSecurityAdvisories:
|
||||
#: Every caller of ``_run_privileged``, with an answer that satisfies it.
|
||||
_CALLERS = {
|
||||
"reboot_host": (lambda d: d.reboot_host(), ["__NETORK_RC=0"]),
|
||||
"shutdown_host": (lambda d: d.shutdown_host(), ["__NETORK_RC=0"]),
|
||||
"refresh apt": (lambda d: d.refresh_available_updates(), ["__NETORK_RC=0"]),
|
||||
"check-update": (
|
||||
lambda d: d.get_available_updates(),
|
||||
|
||||
Reference in new issue
Block a user