From bf90b4e88ae332dd29db156a9e469f69f6f100d2 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Fri, 5 May 2023 07:56:22 +0200 Subject: [PATCH] [PR #6479/57cfd1b4 backport][stable-6] deps module util: fix overzealous name cropping (#6489) deps module util: fix overzealous name cropping (#6479) Fix overzealous name cropping. (cherry picked from commit 57cfd1b46d44ba6ca64206f4606f3bdea3ef3a82) Co-authored-by: Felix Fontein --- changelogs/fragments/deps.yml | 2 ++ plugins/module_utils/deps.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/deps.yml diff --git a/changelogs/fragments/deps.yml b/changelogs/fragments/deps.yml new file mode 100644 index 0000000000..2ad1b7e2c3 --- /dev/null +++ b/changelogs/fragments/deps.yml @@ -0,0 +1,2 @@ +bugfixes: + - "deps module utils - do not fail when dependency cannot be found (https://github.com/ansible-collections/community.general/pull/6479)." diff --git a/plugins/module_utils/deps.py b/plugins/module_utils/deps.py index f6f4082a36..a2413d1952 100644 --- a/plugins/module_utils/deps.py +++ b/plugins/module_utils/deps.py @@ -80,7 +80,7 @@ def _select_names(spec): for d in spec_split: dep_names.remove(d) else: - spec_split = spec[1:].split(":") + spec_split = spec.split(":") dep_names = [] for d in spec_split: _deps[d] # ensure it exists