feat(scheduled-jobs): OMV's own jobs through Cron RPC, generated files platform (#18)
driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 14s
driver / test (3.12) (pull_request) Failing after 46s
driver / test (3.13) (pull_request) Failing after 43s
driver / types (pull_request) Failing after 1m1s
driver / lowest (pull_request) Failing after 20s
driver / build (pull_request) Successful in 27s
driver / security (pull_request) Failing after 1m4s
CI / driver (pull_request) Failing after 2m16s
driver / publish (pull_request) Skipped
driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 14s
driver / test (3.12) (pull_request) Failing after 46s
driver / test (3.13) (pull_request) Failing after 43s
driver / types (pull_request) Failing after 1m1s
driver / lowest (pull_request) Failing after 20s
driver / build (pull_request) Successful in 27s
driver / security (pull_request) Failing after 1m4s
CI / driver (pull_request) Failing after 2m16s
driver / publish (pull_request) Skipped
OpenMediaVault writes several cron files itself, from its own database, and writes them again on every apply: an edit napalm-linux made there would be taken back without a word. So every file OMV generates (/etc/cron.d/openmediavault-*, the mail-queue flush, apticron and the recycle-bin cleanup) is platform and only runs; the inherited writers refuse it. The web UI's "Scheduled Jobs" and the power-management schedule live in conf.system.cron.job. They are read through Cron.getList, disabled ones included, instead of the lines OMV generates for them, and switched with Cron.set, run with Cron.execute (followed through Exec.getOutput), made with Cron.set and removed with Cron.delete. An application's job on OMV is an OMV job, visible in its web UI, marked by its comment. Each write applies the cron module alone, so changes pending in the web UI for other modules stay pending. Every other job keeps napalm-linux's behaviour. Requires napalm-device-types 4.26.0 and napalm-linux 0.16.0. Closes #18
This commit is contained in:
1 parent
a0d28fc939
commit
cc00c225a2
6 files changed
+1137
-7
No files matched your search
@@ -38,6 +38,7 @@ from napalm_device_types.models import (
|
||||
from napalm_linux.linux import LinuxDriver
|
||||
|
||||
from napalm_openmediavault._local_accounts import OmvLocalAccountsMixin
|
||||
from napalm_openmediavault._scheduled_jobs import OmvScheduledJobsMixin
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -159,15 +160,18 @@ def _pool_of(disk: str, members: dict[str, str]) -> str:
|
||||
return next((array for member, array in members.items() if own.fullmatch(member)), "")
|
||||
|
||||
|
||||
class OpenMediaVaultDriver(OmvLocalAccountsMixin, StorageDriver, LinuxDriver):
|
||||
class OpenMediaVaultDriver(
|
||||
OmvLocalAccountsMixin, OmvScheduledJobsMixin, StorageDriver, LinuxDriver
|
||||
):
|
||||
"""NAPALM driver for OpenMediaVault NAS systems.
|
||||
|
||||
Declares both roles it fills: a NAS built on Debian. Storage comes first,
|
||||
so netOrk shows it as storage rather than as a Linux host.
|
||||
|
||||
Inherits all Linux OS functionality from LinuxDriver (packages, services,
|
||||
users, processes, cron, Docker) -- OMV really is Debian, so apt applies --
|
||||
and adds OMV-specific storage management on top.
|
||||
users, processes, scheduled jobs, Docker) -- OMV really is Debian, so apt
|
||||
applies -- and adds OMV-specific storage management on top. The scheduled
|
||||
jobs of OMV's web UI go through its RPC (``_scheduled_jobs``).
|
||||
|
||||
NAS services are ``get_storage_services()``; the systemd service list stays
|
||||
``get_services()``. Two names for two different things.
|
||||
|
||||
Reference in new issue
Block a user