yum hosts: parse_dnf_security raises on yum output with napalm-device-types >= 4.7; rename get_users to get_os_users #26

Closed
opened 2026-10-13 06:12:00 +00:00 by christianmanivong · 2 comments
Owner

napalm-device-types 4.7.0 changed parse_dnf_security: it now expects the __DNF_RC= marker that DNF_SECURITY_COMMAND prints and raises ValueError without it (a failed dnf must not read as "no security advisories").

napalm-linux passes it the output of its own _YUM_SECURITY_COMMAND on yum hosts (_rpm_security_names, napalm_linux/linux.py on master around line 1515):

cmd = DNF_SECURITY_COMMAND if self._pkg_manager == "dnf" else _YUM_SECURITY_COMMAND
...
return parse_dnf_security(output) if status == 0 else None

_YUM_SECURITY_COMMAND (LC_ALL=C yum updateinfo list security -q 2>/dev/null) prints no __DNF_RC= line, so once napalm-linux runs against napalm-device-types >= 4.7.0, every yum host's update listing raises instead of marking security updates.

Not live yet: netOrk still pins napalm-device-types at e58b65a (4.5.1). It breaks with the pin bump.

Fix: give the yum command the same marker ({ ...; echo __DNF_RC=$?; } | cat), or parse yum output with its own function. Add a regression test with recorded yum output.

Also in the same bump: OSDriver.get_users is now get_os_users (napalm-device-types 4.7.0, BREAKING CHANGE). LinuxDriver.get_users (OS user list shape) must be renamed, or it shadows nothing and the OS contract method is missing.

Tracking: NetOrk/netork (napalm-device-types 4.7 bump issue).

Priority: P3 (latent until the pin bump, then breaks yum hosts).

napalm-device-types 4.7.0 changed `parse_dnf_security`: it now expects the `__DNF_RC=` marker that `DNF_SECURITY_COMMAND` prints and raises `ValueError` without it (a failed dnf must not read as "no security advisories"). napalm-linux passes it the output of its own `_YUM_SECURITY_COMMAND` on yum hosts (`_rpm_security_names`, `napalm_linux/linux.py` on master around line 1515): ```python cmd = DNF_SECURITY_COMMAND if self._pkg_manager == "dnf" else _YUM_SECURITY_COMMAND ... return parse_dnf_security(output) if status == 0 else None ``` `_YUM_SECURITY_COMMAND` (`LC_ALL=C yum updateinfo list security -q 2>/dev/null`) prints no `__DNF_RC=` line, so once napalm-linux runs against napalm-device-types >= 4.7.0, every yum host's update listing raises instead of marking security updates. Not live yet: netOrk still pins napalm-device-types at e58b65a (4.5.1). It breaks with the pin bump. Fix: give the yum command the same marker (`{ ...; echo __DNF_RC=$?; } | cat`), or parse yum output with its own function. Add a regression test with recorded yum output. Also in the same bump: `OSDriver.get_users` is now `get_os_users` (napalm-device-types 4.7.0, BREAKING CHANGE). `LinuxDriver.get_users` (OS user list shape) must be renamed, or it shadows nothing and the OS contract method is missing. Tracking: NetOrk/netork (napalm-device-types 4.7 bump issue). Priority: P3 (latent until the pin bump, then breaks yum hosts).
Author
Owner

Tracked in NetOrk/netork#1096.

Tracked in NetOrk/netork#1096.
Author
Owner

Already fixed on main by 350e3a6 ("fix: adapt to napalm-device-types 4.7", 2026-10-13): the yum security command reports its own exit status, get_os_users exists (linux.py:1816) and get_users is gone.

Already fixed on main by 350e3a6 ("fix: adapt to napalm-device-types 4.7", 2026-10-13): the yum security command reports its own exit status, `get_os_users` exists (`linux.py:1816`) and `get_users` is gone.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-linux#26