From e748faea00346aeb1a05a1810a386b1f3d21fa75 Mon Sep 17 00:00:00 2001
From: Piotr Parczewski <piotr.parczewski@outlook.com>
Date: Fri, 20 Nov 2020 13:08:49 +0100
Subject: [PATCH] Fix Python setup when venv is not used

Set packages argument explicitly as a list to avoid "No package matching
'<generator object select_or_reject at 0x7ff25f341750>' is available" error.

Story: 2008378
Task: 41298
Change-Id: Ibe44583cb93b7dca8f5091c893386a15288af915
---
 ansible/kayobe-target-venv.yml                            | 2 +-
 releasenotes/notes/fix-python-setup-5e7ff929a6cab092.yaml | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
 create mode 100644 releasenotes/notes/fix-python-setup-5e7ff929a6cab092.yaml

diff --git a/ansible/kayobe-target-venv.yml b/ansible/kayobe-target-venv.yml
index f9e6543d0..6b6d364ca 100644
--- a/ansible/kayobe-target-venv.yml
+++ b/ansible/kayobe-target-venv.yml
@@ -89,7 +89,7 @@
               - python3-setuptools
               - python3-pip
           package:
-            name: "{{ packages | select }}"
+            name: "{{ packages | select | list }}"
             state: present
           become: True
       when: virtualenv is not defined
diff --git a/releasenotes/notes/fix-python-setup-5e7ff929a6cab092.yaml b/releasenotes/notes/fix-python-setup-5e7ff929a6cab092.yaml
new file mode 100644
index 000000000..2dcd3c676
--- /dev/null
+++ b/releasenotes/notes/fix-python-setup-5e7ff929a6cab092.yaml
@@ -0,0 +1,5 @@
+---
+fixes:
+  - |
+    Fixes an issue with Python setup when venv is not used. See `story 2008378
+    <https://storyboard.openstack.org/#!/story/22008378>`__ for details.