mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-02-04 07:51:50 +00:00
[PR #11332/280d269d backport][stable-11] fix: listen_ports_facts return no facts when using with podman (#11334)
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
---------
(cherry picked from commit 280d269d78)
Co-authored-by: Daniel Gonçalves <dangoncalves@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
57b3ce9572
commit
9d7fe2f0ae
2 changed files with 4 additions and 2 deletions
|
|
@ -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).
|
||||||
|
|
@ -302,10 +302,10 @@ def ss_parse(raw):
|
||||||
|
|
||||||
conns = regex_conns.search(local_addr_port)
|
conns = regex_conns.search(local_addr_port)
|
||||||
pids = regex_pid.findall(process)
|
pids = regex_pid.findall(process)
|
||||||
if conns is None and pids is None:
|
if conns is None and not pids:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if pids is None:
|
if not pids:
|
||||||
# likely unprivileged user, so add empty name & pid
|
# likely unprivileged user, so add empty name & pid
|
||||||
# as we do in netstat logic to be consistent with output
|
# as we do in netstat logic to be consistent with output
|
||||||
pids = [(str(), 0)]
|
pids = [(str(), 0)]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue