LinuxDriver implements get_services() (systemd, with a SysV fallback) but has no manage_service(), the counterpart declared in napalm_device_types/services.py. On the deployed engine (172.22.8.50) both of these are False:
hasattr(LinuxDriver, "manage_service")
hasattr(OpenMediaVaultDriver, "manage_service") (it inherits from Linux)
netOrk offers Start/Stop/Restart/Enable/Disable for every service it lists. On 23 Linux hosts and one OMV host each of those calls ends in an AttributeError, so the buttons do nothing (the netOrk side is tracked in NetOrk/netork).
Validate the name against [A-Za-z0-9_.@-]+. That admits template units (wg-quick@wg0, openvpn@server) and dotted ones (snapd.apparmor), and nothing a shell reads.
On a SysV host (no systemctl), fall back to service {name} {start|stop|restart}. Report enable/disable as unsupported there.
Return {"success": bool, "output": str}. Unlike napalm-proxmox, do not append || true: a failed systemctl should say so.
## What happens
`LinuxDriver` implements `get_services()` (systemd, with a SysV fallback) but has no `manage_service()`, the counterpart declared in `napalm_device_types/services.py`. On the deployed engine (172.22.8.50) both of these are `False`:
- `hasattr(LinuxDriver, "manage_service")`
- `hasattr(OpenMediaVaultDriver, "manage_service")` (it inherits from Linux)
netOrk offers Start/Stop/Restart/Enable/Disable for every service it lists. On 23 Linux hosts and one OMV host each of those calls ends in an `AttributeError`, so the buttons do nothing (the netOrk side is tracked in NetOrk/netork).
## Proposal
Mirror `napalm-proxmox`'s `manage_service()`:
- `sudo systemctl {start|stop|restart|enable|disable} {name}.service`
- Validate the name against `[A-Za-z0-9_.@-]+`. That admits template units (`wg-quick@wg0`, `openvpn@server`) and dotted ones (`snapd.apparmor`), and nothing a shell reads.
- On a SysV host (no `systemctl`), fall back to `service {name} {start|stop|restart}`. Report enable/disable as unsupported there.
- Return `{"success": bool, "output": str}`. Unlike napalm-proxmox, do not append `|| true`: a failed `systemctl` should say so.
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.
What happens
LinuxDriverimplementsget_services()(systemd, with a SysV fallback) but has nomanage_service(), the counterpart declared innapalm_device_types/services.py. On the deployed engine (172.22.8.50) both of these areFalse:hasattr(LinuxDriver, "manage_service")hasattr(OpenMediaVaultDriver, "manage_service")(it inherits from Linux)netOrk offers Start/Stop/Restart/Enable/Disable for every service it lists. On 23 Linux hosts and one OMV host each of those calls ends in an
AttributeError, so the buttons do nothing (the netOrk side is tracked in NetOrk/netork).Proposal
Mirror
napalm-proxmox'smanage_service():sudo systemctl {start|stop|restart|enable|disable} {name}.service[A-Za-z0-9_.@-]+. That admits template units (wg-quick@wg0,openvpn@server) and dotted ones (snapd.apparmor), and nothing a shell reads.systemctl), fall back toservice {name} {start|stop|restart}. Report enable/disable as unsupported there.{"success": bool, "output": str}. Unlike napalm-proxmox, do not append|| true: a failedsystemctlshould say so.