Skip to content

Commit 9d7fe2f

Browse files
patchback[bot]dangoncalvesfelixfontein
authored
[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 280d269) Co-authored-by: Daniel Gonçalves <dangoncalves@users.noreply.github.com> Co-authored-by: Felix Fontein <felix@fontein.de>
1 parent 57b3ce9 commit 9d7fe2f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bugfixes:
2+
- listen_ports_facts - fix handling of empty PID lists when ``command=ss`` (https://github.com/ansible-collections/community.general/pull/11332).

plugins/modules/listen_ports_facts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,10 @@ def ss_parse(raw):
302302

303303
conns = regex_conns.search(local_addr_port)
304304
pids = regex_pid.findall(process)
305-
if conns is None and pids is None:
305+
if conns is None and not pids:
306306
continue
307307

308-
if pids is None:
308+
if not pids:
309309
# likely unprivileged user, so add empty name & pid
310310
# as we do in netstat logic to be consistent with output
311311
pids = [(str(), 0)]

0 commit comments

Comments
 (0)