[libvirt] [jenkins-ci PATCH 3/3] lcitool: Fix pip use on CentOS 7

Andrea Bolognani abologna at redhat.com
Tue Jan 7 15:50:20 UTC 2020


The 'pip' Ansible module doesn't work correctly when there is a
mismatch between the Python version we're adding packages to and
the one used to run Ansible itself: this is the case on CentOS 7,
where we have Python 3 for the former but Python 2 for the latter.

Call pip3 manually using the 'command' module instead to work
around this issue.

Signed-off-by: Andrea Bolognani <abologna at redhat.com>
---
 guests/playbooks/update/tasks/packages.yml | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/guests/playbooks/update/tasks/packages.yml b/guests/playbooks/update/tasks/packages.yml
index fc8a3d1..4e7d5f6 100644
--- a/guests/playbooks/update/tasks/packages.yml
+++ b/guests/playbooks/update/tasks/packages.yml
@@ -143,7 +143,8 @@
     - pip_resolved[item] not in pip_flattened
 
 - name: '{{ project }}: Install packages from pip (state={{ state }})'
-  pip:
-    name: '{{ pip_flattened|sort }}'
-    executable: pip3
-    state: '{{ state }}'
+  command: 'pip3 install {{ item }}'
+  args:
+    warn: no
+  with_items:
+    '{{ pip_flattened|sort }}'
-- 
2.24.1




More information about the libvir-list mailing list