1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-02-03 23:41:51 +00:00

fix: listen_ports_facts return no facts when using with podman (#11332)

* fix: listen_ports_facts return no facts when using with podman

* Update changelogs/fragments/listen-ports-facts-return-no-facts.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Daniel Gonçalves 2025-12-28 21:02:31 +01:00 committed by GitHub
parent 9f5114dc76
commit 280d269d78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- listen_ports_facts - fix handling of empty PID lists when ``command=ss`` (https://github.com/ansible-collections/community.general/pull/11332).

View file

@ -305,10 +305,10 @@ def ss_parse(raw):
conns = regex_conns.search(local_addr_port)
pids = regex_pid.findall(process)
if conns is None and pids is None:
if conns is None and not pids:
continue
if pids is None:
if not pids:
# likely unprivileged user, so add empty name & pid
# as we do in netstat logic to be consistent with output
pids = [("", 0)]