From 8f364b549b5894564f19872904c74768f63201e9 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Tue, 30 Aug 2016 18:49:58 +0200 Subject: [PATCH] Fix indexed_items.py to run on python3 (#17292) On python3, zip is a iterator so we need to explictily create the list from that. --- lib/ansible/plugins/lookup/indexed_items.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/plugins/lookup/indexed_items.py b/lib/ansible/plugins/lookup/indexed_items.py index 9e242ac6bfc..da06de97e3e 100644 --- a/lib/ansible/plugins/lookup/indexed_items.py +++ b/lib/ansible/plugins/lookup/indexed_items.py @@ -31,5 +31,5 @@ class LookupModule(LookupBase): raise AnsibleError("with_indexed_items expects a list") items = self._flatten(terms) - return zip(range(len(items)), items) + return list(zip(range(len(items)), items))