feat: apt's errors come through, unreadable sources raise PackageSourcesUnreadable, 4.57.0 (NetOrk/netork#3087) #146

Merged
christianmanivong merged 1 commits from fix/apt-sources-unreadable into main 2026-12-03 12:06:49 +00:00
Owner

For NetOrk/netork#3087.

One bad apt source line (two Signed-By for one repository) makes apt refuse every source. The update read then failed with only "apt list --upgradable failed with exit status 100", because APT_UPGRADABLE_COMMAND threw stderr away.

  • APT_UPGRADABLE_COMMAND passes apt's E: lines on, marked __APT_E: (stdout goes around the pipe on fd 3, plain sh); apt's warnings stay out as before.
  • parse_apt_upgradable raises the new PackageSourcesUnreadable (a ValueError, so existing except ValueError callers such as napalm-proxmox keep working) with apt's errors when apt says "The list of sources could not be read.", and names apt's errors after the exit status for any other failure.
  • 4.57.0, CHANGELOG.

Tests: parser cases plus one that runs the real command in sh against a conflicting sources dir (APT_CONFIG). Full suite 2349 passed; napalm-linux (481) and napalm-proxmox (806) pass against it.

For NetOrk/netork#3087. One bad apt source line (two `Signed-By` for one repository) makes apt refuse **every** source. The update read then failed with only "apt list --upgradable failed with exit status 100", because `APT_UPGRADABLE_COMMAND` threw stderr away. - `APT_UPGRADABLE_COMMAND` passes apt's `E:` lines on, marked `__APT_E:` (stdout goes around the pipe on fd 3, plain `sh`); apt's warnings stay out as before. - `parse_apt_upgradable` raises the new `PackageSourcesUnreadable` (a `ValueError`, so existing `except ValueError` callers such as napalm-proxmox keep working) with apt's errors when apt says "The list of sources could not be read.", and names apt's errors after the exit status for any other failure. - 4.57.0, CHANGELOG. Tests: parser cases plus one that runs the real command in `sh` against a conflicting sources dir (`APT_CONFIG`). Full suite 2349 passed; napalm-linux (481) and napalm-proxmox (806) pass against it.
christianmanivong added 1 commit 2026-12-03 12:03:49 +00:00
feat: apt's errors come through, unreadable sources raise PackageSourcesUnreadable, 4.57.0 (NetOrk/netork#3087)
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 16s
driver / lowest (pull_request) Successful in 45s
driver / types (pull_request) Successful in 1m9s
driver / test (3.12) (pull_request) Successful in 1m19s
driver / test (3.13) (pull_request) Successful in 1m19s
driver / build (pull_request) Successful in 37s
driver / security (pull_request) Successful in 1m10s
CI / driver (pull_request) Successful in 2m14s
driver / publish (pull_request) Skipped
9efc3275b1
One bad apt source line, two Signed-By for one repository, makes apt refuse
every source. The update read then failed with "exit status 100" and nothing
else, because APT_UPGRADABLE_COMMAND threw stderr away.

The command now passes apt's E: lines on, marked __APT_E:, and still keeps
its warnings out. parse_apt_upgradable raises PackageSourcesUnreadable, a
ValueError, with apt's errors when apt could not read its sources, and names
them after the exit status for any other failure.
christianmanivong merged commit 73ddc08025 into main 2026-12-03 12:06:49 +00:00
christianmanivong deleted branch fix/apt-sources-unreadable 2026-12-03 12:06:49 +00:00
Sign in to join this conversation.