From c999822d59687abcc4baa6c61ba5b11627c11729 Mon Sep 17 00:00:00 2001 From: Christian Manivong Date: Sun, 1 Nov 2026 12:03:02 +0100 Subject: [PATCH] fix: no account of netOrk's own on QTS either (NetOrk/netork#1817) QTS manages its users in its own UI and ships no shadow-utils, so add_service_account, inherited from LinuxDriver, is switched off like the personal accounts. --- CHANGELOG.md | 2 ++ napalm_qnap_qts/qnap_qts.py | 4 +++- tests/test_qnap_qts.py | 6 ++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cacd8e..5a19085 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 `lock_local_account` = `None`). napalm-linux now adds and locks accounts with `useradd`/`usermod` (NetOrk/netork#1793); QTS manages its users in its own UI and ships no shadow-utils. A QTS variant follows once it can be built against a real box. +- netOrk's own account (`add_service_account`, NetOrk/netork#1817) is switched off for the + same reason. - `set_hostname` is switched off (`= None`). napalm-linux now renames a host through `hostnamectl` and `/etc/hostname` (NAPALM/napalm-linux#45), which QTS would report as done and lose on the next boot: its name lives in `uLinux.conf`, `/etc` in RAM. netOrk diff --git a/napalm_qnap_qts/qnap_qts.py b/napalm_qnap_qts/qnap_qts.py index e52cfd5..255081c 100644 --- a/napalm_qnap_qts/qnap_qts.py +++ b/napalm_qnap_qts/qnap_qts.py @@ -90,10 +90,12 @@ class QnapQtsDriver(StorageDriver, HypervisorDriver, LinuxDriver): set_hostname = None # type: ignore[assignment] #: QTS manages its users in its own UI and ships no shadow-utils (useradd, #: usermod, gpasswd) for LinuxDriver's accounts. Off until a QTS variant is - #: built against a real box (NetOrk/netork#1793). + #: built against a real box (NetOrk/netork#1793), netOrk's own account + #: included (NetOrk/netork#1817). get_local_accounts = None # type: ignore[assignment] add_local_account = None # type: ignore[assignment] lock_local_account = None # type: ignore[assignment] + add_service_account = None # type: ignore[assignment] SNMP_OBJECT_ID_PREFIX = QNAP_ENTERPRISE_OID SNMP_FINGERPRINT = [ diff --git a/tests/test_qnap_qts.py b/tests/test_qnap_qts.py index c38abfe..10f8691 100644 --- a/tests/test_qnap_qts.py +++ b/tests/test_qnap_qts.py @@ -237,10 +237,12 @@ def test_hostname_is_not_set_here(): def test_personal_accounts_are_not_managed_here(): """QTS manages its users in its own UI and ships no shadow-utils for the - ``useradd``/``usermod`` inherited from LinuxDriver (NetOrk/netork#1793).""" + ``useradd``/``usermod`` inherited from LinuxDriver (NetOrk/netork#1793), and + so no account of netOrk's own either (NetOrk/netork#1817).""" from napalm_linux.linux import LinuxDriver - for action in ("get_local_accounts", "add_local_account", "lock_local_account"): + actions = ("get_local_accounts", "add_local_account", "lock_local_account") + for action in (*actions, "add_service_account"): assert callable(getattr(LinuxDriver, action, None)) assert not callable(getattr(QnapQtsDriver, action, None)) -- 2.54.1