Scheduled jobs on both drivers of the package, proxmox (ProxmoxDriver) and proxmox_backup (ProxmoxBackupDriver), through napalm-device-types' PosixScheduledJobsMixin over the node's root SSH session (run_command).
Changes
napalm_proxmox/scheduled_jobs.py: ProxmoxScheduledJobsMixin (the POSIX mixin plus RUN_ONLY_SOURCES), PVE_PLATFORM_SOURCES, PBS_PLATFORM_SOURCES.
platform on Proxmox VE: /usr/lib/systemd/system/pve-*, /lib/systemd/system/pve-* (pve-daily-update.timer), pvesr.timer (replication before PVE 7), /etc/cron.d/vzdump. On a backup server: proxmox-backup* units (proxmox-backup-daily-update.timer). Everything else stays package / admin as the mixin reads it.
A line in /etc/cron.d/vzdump only takes run: the file is a link to /etc/pve/vzdump.cron on the cluster file system (pmxcfs), where installing a file with a mode and owner is not safe.
Not scheduled jobs here: /cluster/backup jobs, replication, and PBS verify/prune/sync/GC jobs. Proxmox runs them in its own daemons; get_clusters() / get_backup_jobs() keep them.
tests/test_scheduled_jobs.py: each driver offers the four verbs and reads once through run_command as root; platform classification per driver (PVE names are not platform on PBS); a vzdump line refuses disable and writes nothing.
Full suite 608 passed, coverage 82 % (floor 68); ruff, mypy strict, napalm-standard check and ratchet, bandit clean.
Not tried on a real node.
## Summary
Scheduled jobs on both drivers of the package, `proxmox` (`ProxmoxDriver`) and `proxmox_backup` (`ProxmoxBackupDriver`), through napalm-device-types' `PosixScheduledJobsMixin` over the node's root SSH session (`run_command`).
## Changes
- `napalm_proxmox/scheduled_jobs.py`: `ProxmoxScheduledJobsMixin` (the POSIX mixin plus `RUN_ONLY_SOURCES`), `PVE_PLATFORM_SOURCES`, `PBS_PLATFORM_SOURCES`.
- `platform` on Proxmox VE: `/usr/lib/systemd/system/pve-*`, `/lib/systemd/system/pve-*` (`pve-daily-update.timer`), `pvesr.timer` (replication before PVE 7), `/etc/cron.d/vzdump`. On a backup server: `proxmox-backup*` units (`proxmox-backup-daily-update.timer`). Everything else stays `package` / `admin` as the mixin reads it.
- A line in `/etc/cron.d/vzdump` only takes `run`: the file is a link to `/etc/pve/vzdump.cron` on the cluster file system (pmxcfs), where installing a file with a mode and owner is not safe.
- Not scheduled jobs here: `/cluster/backup` jobs, replication, and PBS verify/prune/sync/GC jobs. Proxmox runs them in its own daemons; `get_clusters()` / `get_backup_jobs()` keep them.
- `napalm_device_types>=4.26.0`; CHANGELOG, README.
## Related Issue
Closes #56
Part of NetOrk/netork#1933 (needs NAPALM/napalm-device-types#87 released as 4.26.0).
## Testing
- `tests/test_scheduled_jobs.py`: each driver offers the four verbs and reads once through `run_command` as root; platform classification per driver (PVE names are not platform on PBS); a vzdump line refuses `disable` and writes nothing.
- Full suite 608 passed, coverage 82 % (floor 68); ruff, mypy strict, napalm-standard check and ratchet, bandit clean.
- Not tried on a real node.
Both drivers mix in napalm-device-types' PosixScheduledJobsMixin over the
node's root SSH session: get_scheduled_jobs reads cron, run-parts, anacron
and every systemd timer in one round trip; manage_scheduled_job enables,
disables or runs one now; put_ and delete_scheduled_job write and remove an
application's own job.
What Proxmox ships is platform, so it is only switched and run: pve-*
units, pvesr.timer and /etc/cron.d/vzdump on Proxmox VE, proxmox-backup*
units on a backup server. A vzdump cron line is only run, because the file
is a link into /etc/pve and rewriting it would replace the link with a
plain file.
Backup jobs (/cluster/backup), replication and a backup server's verify,
prune, sync and GC jobs run in Proxmox's own daemons and stay with the
backup features.
Requires napalm-device-types 4.26.0.
Closes#56
The guard is not about the link: napalm-device-types now writes the file a
link names. /etc/cron.d/vzdump points into /etc/pve, the cluster file
system, where installing a file with a mode and owner is not safe.
Refs #56
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.
Summary
Scheduled jobs on both drivers of the package,
proxmox(ProxmoxDriver) andproxmox_backup(ProxmoxBackupDriver), through napalm-device-types'PosixScheduledJobsMixinover the node's root SSH session (run_command).Changes
napalm_proxmox/scheduled_jobs.py:ProxmoxScheduledJobsMixin(the POSIX mixin plusRUN_ONLY_SOURCES),PVE_PLATFORM_SOURCES,PBS_PLATFORM_SOURCES.platformon Proxmox VE:/usr/lib/systemd/system/pve-*,/lib/systemd/system/pve-*(pve-daily-update.timer),pvesr.timer(replication before PVE 7),/etc/cron.d/vzdump. On a backup server:proxmox-backup*units (proxmox-backup-daily-update.timer). Everything else stayspackage/adminas the mixin reads it./etc/cron.d/vzdumponly takesrun: the file is a link to/etc/pve/vzdump.cronon the cluster file system (pmxcfs), where installing a file with a mode and owner is not safe./cluster/backupjobs, replication, and PBS verify/prune/sync/GC jobs. Proxmox runs them in its own daemons;get_clusters()/get_backup_jobs()keep them.napalm_device_types>=4.26.0; CHANGELOG, README.Related Issue
Closes #56
Part of NetOrk/netork#1933 (needs NAPALM/napalm-device-types#87 released as 4.26.0).
Testing
tests/test_scheduled_jobs.py: each driver offers the four verbs and reads once throughrun_commandas root; platform classification per driver (PVE names are not platform on PBS); a vzdump line refusesdisableand writes nothing.