networks: keep name and id filters in list() #751
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
if you like to contribute on the issue please make sure assign the issue or at least communicate with @containers/podman-py-maintainers, best to directly communicate on the issues before putting out PRs. Thanks.
Thanks, and sorry for jumping straight to a PR. I've left a note on #748 now and will ask on the issue first next time. Happy to change the approach, or close this if someone else is already on it.
LGTM
Thanks @bardrop
LGTM
TomSweeneyRedHat
bardrop
Fixes #748
NetworksManager.list()always did:So
list(filters={"name": "db"})setnameback toNone,prepare_filters()dropped it, and the request went out with no filter at all. It also wrote into the caller's dict.Now the mapping is copied first, and
name/idare only set whennames/idsare passed (same pattern asImagesManager.list()).Tests: two new unit tests in
test_networksmanager.py(filters passed through + dict not changed;names/idscombined with other filters). Both fail on main and pass with the fix.pytest podman/tests/unit(402 passed;test_utils.pyskipped locally since it needs/etc/os-release),ruff checkandruff format --checkclean.Signed-off-by: Mradul Singh <msingh@dealmeridian.com>