From fca16d8fdbebdb57729f7f881c7a592894e1cac1 Mon Sep 17 00:00:00 2001 From: PKehnel Date: Sat, 3 Sep 2022 12:04:42 +0200 Subject: [PATCH] Bugfix - EnvironmentError with wrong indentation (#5202) * The EnvironmentError is now handled in the splid_pid_name function. The error also had a wrong indentation. See previous setup with correct setup: https://github.com/ansible-collections/community.general/blob/6a7811f6963ad1f5f92342b786e70a809e1c9e08/plugins/modules/system/listen_ports_facts.py * Add changelog fragment * Sanity Check failed before * Update changelogs/fragments/5202-bugfix-environmentError-wrong-indentation.yaml Co-authored-by: Paul-Kehnel Co-authored-by: Felix Fontein --- .../5202-bugfix-environmentError-wrong-indentation.yaml | 2 ++ plugins/modules/system/listen_ports_facts.py | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/5202-bugfix-environmentError-wrong-indentation.yaml diff --git a/changelogs/fragments/5202-bugfix-environmentError-wrong-indentation.yaml b/changelogs/fragments/5202-bugfix-environmentError-wrong-indentation.yaml new file mode 100644 index 00000000000..d9001169b0a --- /dev/null +++ b/changelogs/fragments/5202-bugfix-environmentError-wrong-indentation.yaml @@ -0,0 +1,2 @@ +bugfixes: + - listen_ports_facts - removed leftover ``EnvironmentError`` . The ``else`` clause had a wrong indentation. The check is now handled in the ``split_pid_name`` function (https://github.com//pull/5202). \ No newline at end of file diff --git a/plugins/modules/system/listen_ports_facts.py b/plugins/modules/system/listen_ports_facts.py index c137a33e427..fc4afa6d7bd 100644 --- a/plugins/modules/system/listen_ports_facts.py +++ b/plugins/modules/system/listen_ports_facts.py @@ -257,8 +257,6 @@ def netStatParse(raw): } if result not in results: results.append(result) - else: - raise EnvironmentError('Could not get process information for the listening ports.') return results