chore: adopt the NAPALM driver standard
driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 12s
driver / types (pull_request) Successful in 55s
driver / test (3.10) (pull_request) Successful in 58s
driver / test (3.11) (pull_request) Successful in 56s
driver / lowest (pull_request) Successful in 26s
driver / test (3.12) (pull_request) Successful in 55s
driver / test (3.13) (pull_request) Successful in 48s
driver / build (pull_request) Successful in 24s
driver / security (pull_request) Successful in 58s
CI / driver (pull_request) Successful in 3m0s
driver / publish (pull_request) Skipped
driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 12s
driver / types (pull_request) Successful in 55s
driver / test (3.10) (pull_request) Successful in 58s
driver / test (3.11) (pull_request) Successful in 56s
driver / lowest (pull_request) Successful in 26s
driver / test (3.12) (pull_request) Successful in 55s
driver / test (3.13) (pull_request) Successful in 48s
driver / build (pull_request) Successful in 24s
driver / security (pull_request) Successful in 58s
CI / driver (pull_request) Successful in 3m0s
driver / publish (pull_request) Skipped
- CI moves to .gitea/workflows/ci.yml and calls the shared driver workflow of NAPALM/driver-standard; napalm-device-types and napalm-linux come from git until napalm-linux 0.15.0 is on PyPI. - requires-python >=3.10 (napalm-device-types needs it), SPDX license string, setuptools>=77, LICENSE file, py.typed, links to git.netork.io. - Dependencies: napalm-device-types>=4.22.0, napalm-linux>=0.15.0, napalm>=4.0 (tested at 4.0.0); dev extra with pytest, pytest-cov, mypy and ruff. - mypy strict for the whole package, no exempt module: _omv_read is annotated as returning list[dict[str, Any]] (types only). - Coverage floor 15 % (measured 15.89 %); the four long getters and the complexity of get_disks are recorded in the quality baseline. - README (what it is, how it connects, the getters, what it does not do) and CHANGELOG are new. - The committed egg-info and __pycache__ files are untracked; .gitignore from the template keeps them, .venv and build output out.
This commit is contained in:
1 parent
9fbbd17530
commit
aba36b3b11
20 files changed
+359
-98
No files matched your search
@@ -0,0 +1,72 @@
|
||||
# napalm-openmediavault
|
||||
|
||||
NAPALM driver for [OpenMediaVault](https://www.openmediavault.org/) NAS systems, built on
|
||||
[napalm-device-types](https://git.netork.io/NAPALM/napalm-device-types) (`StorageDriver`) and
|
||||
[napalm-linux](https://git.netork.io/NAPALM/napalm-linux) (`LinuxDriver`).
|
||||
|
||||
OpenMediaVault is Debian underneath, so the driver inherits everything napalm-linux does for a
|
||||
Linux host (packages, updates, services, users, processes, cron, Docker) and adds the NAS side:
|
||||
disks, md RAID arrays, filesystems, shares and the NAS services.
|
||||
|
||||
## Tested against
|
||||
|
||||
| Model | Firmware |
|
||||
|---|---|
|
||||
| OpenMediaVault | 6.x (Debian Bullseye), 7.x (Debian Bookworm) |
|
||||
|
||||
## Connection
|
||||
|
||||
SSH, port 22 by default, through napalm-linux (Netmiko). The account needs a shell; `smartctl`
|
||||
and `mdadm` run through `sudo` (passwordless, or with `sudo_password`). Every `optional_args`
|
||||
key of napalm-linux is accepted (`port`, `pkg_manager`, `sudo_password`, …).
|
||||
|
||||
```python
|
||||
from napalm import get_network_driver
|
||||
|
||||
driver = get_network_driver("openmediavault")
|
||||
with driver("192.0.2.10", "admin", "secret", optional_args={"sudo_password": "secret"}) as nas:
|
||||
print(nas.get_facts())
|
||||
print(nas.get_disks())
|
||||
print(nas.get_shares())
|
||||
```
|
||||
|
||||
## Supported
|
||||
|
||||
| Getter / action | |
|
||||
|---|---|
|
||||
| `get_facts` | napalm-linux's facts, `os_version` is `OMV <version>` of the `openmediavault` package |
|
||||
| `get_disks` | `lsblk` for the disks, `smartctl -iA` for health, temperature and RPM |
|
||||
| `get_disk_pools` | md arrays from `/proc/mdstat`, size and state from `mdadm --detail` |
|
||||
| `get_volumes` | mounted block-device filesystems from `df`, read-only flag from `/proc/mounts` |
|
||||
| `get_shares` | SMB, NFS and FTP shares from OMV's configuration database (`omv-confdbadm`) |
|
||||
| `get_storage_services` | whether `smbd`, `nfs-server`, `proftpd`, `ssh` and `rsync` are enabled and running |
|
||||
| everything of napalm-linux | packages, updates, services, users, processes, cron, Docker, … |
|
||||
|
||||
"Upgrade everything" is a full upgrade (`FULL_UPGRADE = True`): a plain `apt-get upgrade` holds
|
||||
back OpenMediaVault's own packages and the kernel.
|
||||
|
||||
## Not supported
|
||||
|
||||
- `get_volume_snapshots`, `get_replication_jobs`, `get_quotas` raise `NotImplementedError`.
|
||||
- `harden_ssh_server` is not offered: OpenMediaVault generates `sshd_config` from its own
|
||||
database and would undo a drop-in on the next apply of its SSH settings.
|
||||
- Configuration changes to shares, disks or arrays.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
pip install napalm-openmediavault
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
The rules are in [STANDARDS.md](https://git.netork.io/NAPALM/driver-standard/src/branch/main/STANDARDS.md).
|
||||
|
||||
```bash
|
||||
python -m venv .venv && .venv/bin/pip install -e ".[dev]"
|
||||
.venv/bin/pytest --cov
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Apache-2.0
|
||||
Reference in new issue
Block a user