From 1ee6d53df19feb6b9c485e37b71a2017f529c141 Mon Sep 17 00:00:00 2001 From: David Tulloh Date: Wed, 6 Sep 2023 22:48:00 +1000 Subject: [PATCH] Catch empty collection lists (#332) A file with just `collections:` in it leads to `{'collections':None}` which makes the loop sad. Easier to catch it here. Fixes #4034 --- src/ansible_compat/runtime.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ansible_compat/runtime.py b/src/ansible_compat/runtime.py index 9d921587..bbb5a151 100644 --- a/src/ansible_compat/runtime.py +++ b/src/ansible_compat/runtime.py @@ -548,7 +548,7 @@ def install_requirements( # noqa: C901 raise AnsibleCommandError(result) # Run galaxy collection install works on v2 requirements.yml - if "collections" in reqs_yaml: + if "collections" in reqs_yaml and reqs_yaml["collections"] is not None: cmd = [ "ansible-galaxy", "collection",