From 8f098b14f2b57ae7837ea53d93c019d081f220ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20H=C3=BCgli?= Date: Tue, 16 Feb 2021 18:38:29 +0100 Subject: [PATCH] make has_plugin detection method more reliable (#362) * fix has_plugin detection method * use even better method :) * add changelog fragment * fix forgotten file extension * Double Backticks ;) * Add PR link to changelog Co-authored-by: Mike Graves --- changelogs/fragments/362-helm-has_plugin-fix.yaml | 2 ++ plugins/modules/helm.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/362-helm-has_plugin-fix.yaml diff --git a/changelogs/fragments/362-helm-has_plugin-fix.yaml b/changelogs/fragments/362-helm-has_plugin-fix.yaml new file mode 100644 index 00000000..1794f220 --- /dev/null +++ b/changelogs/fragments/362-helm-has_plugin-fix.yaml @@ -0,0 +1,2 @@ +bugfixes: + - helm - make helm-diff plugin detection more reliable by splitting by any whitespace instead of explicit whitespace (``\s``) (https://github.com/ansible-collections/community.kubernetes/pull/362). diff --git a/plugins/modules/helm.py b/plugins/modules/helm.py index e712227a..2a93a2ed 100644 --- a/plugins/modules/helm.py +++ b/plugins/modules/helm.py @@ -418,7 +418,7 @@ def has_plugin(command, plugin): for line in out.splitlines(): if line.startswith("NAME"): continue - name, _rest = line.split("\t", 1) + name, _rest = line.split(None, 1) if name == plugin: return True return False