Merge pull request 'fix: switch off the inherited personal accounts (NetOrk/netork#1793)' (#15) from feat/local-accounts-opt-out into main
driver / standard (push) Successful in 18s
driver / lint (push) Successful in 16s
driver / types (push) Successful in 1m17s
driver / test (3.12) (push) Successful in 1m23s
driver / test (3.13) (push) Successful in 1m5s
driver / lowest (push) Successful in 46s
driver / build (push) Successful in 38s
driver / security (push) Successful in 1m20s
CI / driver (push) Successful in 3m17s
driver / publish (push) Skipped
driver / standard (push) Successful in 18s
driver / lint (push) Successful in 16s
driver / types (push) Successful in 1m17s
driver / test (3.12) (push) Successful in 1m23s
driver / test (3.13) (push) Successful in 1m5s
driver / lowest (push) Successful in 46s
driver / build (push) Successful in 38s
driver / security (push) Successful in 1m20s
CI / driver (push) Successful in 3m17s
driver / publish (push) Skipped
Reviewed-on: #15
This commit was merged in pull request #15.
This commit is contained in:
commit
b10166b30c
3 files changed
+20
No files matched your search
@@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
- Personal accounts are switched off (`get_local_accounts`, `add_local_account`,
|
||||
`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.
|
||||
- `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
|
||||
|
||||
@@ -88,6 +88,12 @@ class QnapQtsDriver(StorageDriver, HypervisorDriver, LinuxDriver):
|
||||
#: QTS keeps its name in uLinux.conf and /etc in RAM: LinuxDriver's rename
|
||||
#: would report success and be gone after a boot. Off until #13.
|
||||
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).
|
||||
get_local_accounts = None # type: ignore[assignment]
|
||||
add_local_account = None # type: ignore[assignment]
|
||||
lock_local_account = None # type: ignore[assignment]
|
||||
|
||||
SNMP_OBJECT_ID_PREFIX = QNAP_ENTERPRISE_OID
|
||||
SNMP_FINGERPRINT = [
|
||||
|
||||
@@ -235,6 +235,16 @@ def test_hostname_is_not_set_here():
|
||||
assert not callable(getattr(QnapQtsDriver, "set_hostname", None))
|
||||
|
||||
|
||||
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)."""
|
||||
from napalm_linux.linux import LinuxDriver
|
||||
|
||||
for action in ("get_local_accounts", "add_local_account", "lock_local_account"):
|
||||
assert callable(getattr(LinuxDriver, action, None))
|
||||
assert not callable(getattr(QnapQtsDriver, action, None))
|
||||
|
||||
|
||||
class TestFixesQtsCannotTake:
|
||||
"""QTS has no apt, dnf or opkg, and its SNMP agent is configured in its own UI:
|
||||
the fix templates inherited from LinuxDriver are switched off (#7), so a
|
||||
|
||||
Reference in new issue
Block a user