From c0a6194d7369af79f2b884b0af305475ae60ea3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20H=C3=BCgli?= Date: Thu, 4 Feb 2021 21:28:12 +0100 Subject: [PATCH] use even better method :) --- plugins/modules/helm.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/modules/helm.py b/plugins/modules/helm.py index 1da12713..f9aad2be 100644 --- a/plugins/modules/helm.py +++ b/plugins/modules/helm.py @@ -407,9 +407,11 @@ def has_plugin(command, plugin): cmd = command + " plugin list" rc, out, err = run_helm(module, cmd) for line in out.splitlines(): - if line.lstrip().startswith(plugin): + if line.startswith("NAME"): + continue + name, _rest = line.split(None, 1) + if name == plugin: return True - return False def helmdiff_check(module, helm_cmd, release_name, chart_ref, release_values,