Implement reboot_host() — Linux reboots via netOrk never worked #5

Open
opened 2026-09-25 12:57:46 +00:00 by christianmanivong · 0 comments
Owner

Found while fixing christianmanivong/netork#310.

netOrk's reboot path (netork/adapters/napalm/reboot.py::request_reboot) uses the napalm-device-types reboot_host() contract when a driver implements it, and otherwise falls back to /sbin/reboot via _send_command. LinuxDriver has neither — its shell helper is _send — so rebooting a Linux host through POST /devices/{id}/reboot never did anything (it reported success until #310; it now returns an honest 400).

Implement reboot_host() in LinuxDriver (via _sudo, ignoring only the connection drop the reboot causes). OpenMediaVault and QNAP QTS inherit it; worth checking whether QTS needs its own command.

Found while fixing christianmanivong/netork#310. netOrk's reboot path (`netork/adapters/napalm/reboot.py::request_reboot`) uses the napalm-device-types `reboot_host()` contract when a driver implements it, and otherwise falls back to `/sbin/reboot` via `_send_command`. `LinuxDriver` has neither — its shell helper is `_send` — so rebooting a Linux host through `POST /devices/{id}/reboot` never did anything (it reported success until #310; it now returns an honest 400). Implement `reboot_host()` in `LinuxDriver` (via `_sudo`, ignoring only the connection drop the reboot causes). OpenMediaVault and QNAP QTS inherit it; worth checking whether QTS needs its own command.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-linux#5