diff --git a/napalm_proxmox/system_mixin.py b/napalm_proxmox/system_mixin.py index 89425ee..6fdd7d0 100644 --- a/napalm_proxmox/system_mixin.py +++ b/napalm_proxmox/system_mixin.py @@ -244,7 +244,8 @@ class ProxmoxSystemMixin: # Installed packages via SSH dpkg-query raw = self._exec_ssh_command( - "dpkg-query -W -f='${Package}\\t${Version}\\t${db:Status-Status}\\t${Installed-Size}\\n'" + "dpkg-query -W -f=" + "'${Package}\\t${Version}\\t${db:Status-Status}\\t${Installed-Size}\\t${source:Package}\\n'" " 2>/dev/null" ) result: list[_JsonDict] = [] @@ -256,6 +257,9 @@ class ProxmoxSystemMixin: version = parts[1] if len(parts) > 1 else "" status = parts[2] if len(parts) > 2 else "installed" size_kb = parts[3] if len(parts) > 3 else "0" + # Debian source package (differs from the binary for split packages, + # e.g. openssh-server → openssh). Needed for accurate OSV matching. + source_package = parts[4] if len(parts) > 4 and parts[4] else name if not name or status != "installed": continue size_bytes = int(size_kb) * 1024 if size_kb.isdigit() else 0 @@ -266,6 +270,7 @@ class ProxmoxSystemMixin: "description": "", "size": size_bytes, "source": "pve", + "source_package": source_package, "upgrade_version": upgradable.get(name, ""), }) return result