ruff and mypy report nothing that master does not already report.
Closes #6. Builds on NAPALM/napalm-device-types#5 (2.2.0, `SystemdServicesMixin`).
This drops the driver's own `get_services()` and `manage_service()`, which had two problems:
- The parser read the PRESET column (`enabled` was always false).
- `|| true` reported every action as a success.
The shared mixin replaces them. The driver keeps only `_run_service_command`, its exec path as root.
## Checked against a real node (PVE 9.2, netOrk test server)
- **Listing:** 1.7 s, the same as before. 63 services are now correctly `enabled`, and the running state is identical.
- **Leaner list:** 280 → 172 entries, because templates, static and alias unit files are no longer listed.
- **Failed action:** `manage_service("<missing unit>", "restart")` returned a failure with systemctl's message, where it used to report success.
## Tests (no CI in this repo, run locally)
```
$ PYTHONPATH=.:../napalm-device-types pytest -q tests
279 passed
```
ruff and mypy report nothing that `master` does not already report.
get_services() read list-unit-files' second column, which since systemd 245
is followed by a preset column -- "enabled enabled" never equalled
"enabled", so every service on every node was reported disabled (#6).
manage_service() ended in "|| true" and returned success whatever happened.
Both now come from napalm-device-types' SystemdServicesMixin (2.2.0): the
enabled state is UnitFileState from systemctl show, MainPID comes along in
the same round trip, and an action reports systemctl's exit status. The
driver keeps only _run_service_command(), its exec path as root. The exit
status marker keeps the output non-empty, so _exec_ssh_command's SSH fallback
on an empty API answer can no longer run an action twice.
The listing no longer includes templates, static unit files and aliases that
are not loaded (on a PVE 9 node: 280 entries -> 172).
Closes#6
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.
Closes #6. Builds on NAPALM/napalm-device-types#5 (2.2.0,
SystemdServicesMixin).This drops the driver's own
get_services()andmanage_service(), which had two problems:enabledwas always false).|| truereported every action as a success.The shared mixin replaces them. The driver keeps only
_run_service_command, its exec path as root.Checked against a real node (PVE 9.2, netOrk test server)
enabled, and the running state is identical.manage_service("<missing unit>", "restart")returned a failure with systemctl's message, where it used to report success.Tests (no CI in this repo, run locally)
ruff and mypy report nothing that
masterdoes not already report.