The BSD drivers could not restart at all. reboot_host() and shutdown_host() on BsdDriver: /sbin/shutdown -r now / /sbin/shutdown -p now (the same on both BSDs; -p powers off after rc's clean shutdown), detached like the linux driver, through run_command(..., privileged=True). A non-zero exit raises RuntimeError with the host's answer.
No version bump: this repo collects features under [Unreleased]; the entry is there. Tests: TestHostPower (14 cases) in tests/test_drivers.py, including the real sudo line through sh -n; full suite 219 passed.
Part of NetOrk/netork#2841: the device header gets Restart and Shut down for hardware devices. netOrk offers each button where the driver has the method (callable(getattr(driver, "reboot_host" / "shutdown_host", None))), so defining it is what switches the button on. The contracts are HostRebootMixin / HostShutdownMixin in napalm-device-types, already mixed in through DeviceTypeDriver; the minimum napalm-device-types version needs no change.
netOrk's feature/host-shutdown-2841 pins this branch's commit for now; once this is merged, the pin moves to the merge commit.
The BSD drivers could not restart at all. `reboot_host()` and `shutdown_host()` on `BsdDriver`: `/sbin/shutdown -r now` / `/sbin/shutdown -p now` (the same on both BSDs; `-p` powers off after rc's clean shutdown), detached like the linux driver, through `run_command(..., privileged=True)`. A non-zero exit raises `RuntimeError` with the host's answer.
No version bump: this repo collects features under [Unreleased]; the entry is there. Tests: `TestHostPower` (14 cases) in `tests/test_drivers.py`, including the real sudo line through `sh -n`; full suite 219 passed.
Part of NetOrk/netork#2841: the device header gets Restart and Shut down for hardware devices. netOrk offers each button where the driver has the method (`callable(getattr(driver, "reboot_host" / "shutdown_host", None))`), so defining it is what switches the button on. The contracts are `HostRebootMixin` / `HostShutdownMixin` in napalm-device-types, already mixed in through `DeviceTypeDriver`; the minimum napalm-device-types version needs no change.
netOrk's `feature/host-shutdown-2841` pins this branch's commit for now; once this is merged, the pin moves to the merge commit.
The host's restart and its clean shutdown, through napalm-device-types'
HostRebootMixin and HostShutdownMixin: shutdown -r now and shutdown -p now
as root, through the driver's sudo, detached and two seconds late, so the
exit status comes back before the session drops and closing the session
cannot take the command with it. A refusal raises RuntimeError with what
the host said.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The BSD drivers could not restart at all.
reboot_host()andshutdown_host()onBsdDriver:/sbin/shutdown -r now//sbin/shutdown -p now(the same on both BSDs;-ppowers off after rc's clean shutdown), detached like the linux driver, throughrun_command(..., privileged=True). A non-zero exit raisesRuntimeErrorwith the host's answer.No version bump: this repo collects features under [Unreleased]; the entry is there. Tests:
TestHostPower(14 cases) intests/test_drivers.py, including the real sudo line throughsh -n; full suite 219 passed.Part of NetOrk/netork#2841: the device header gets Restart and Shut down for hardware devices. netOrk offers each button where the driver has the method (
callable(getattr(driver, "reboot_host" / "shutdown_host", None))), so defining it is what switches the button on. The contracts areHostRebootMixin/HostShutdownMixinin napalm-device-types, already mixed in throughDeviceTypeDriver; the minimum napalm-device-types version needs no change.netOrk's
feature/host-shutdown-2841pins this branch's commit for now; once this is merged, the pin moves to the merge commit.