From 2e28d75956183b17e5d2332c096575d09f2251ee Mon Sep 17 00:00:00 2001 From: Martin Kopec Date: Mon, 12 Jul 2021 18:54:01 +0000 Subject: [PATCH] Fix python2 check Print python_version to the console for debugging purposes and fix the python2 check condition. Change-Id: I31511d5ac848f4648b230221e1e11f711fb6b918 --- tasks/install-packages.yaml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tasks/install-packages.yaml b/tasks/install-packages.yaml index 4da6500..e77e016 100644 --- a/tasks/install-packages.yaml +++ b/tasks/install-packages.yaml @@ -44,13 +44,17 @@ command: "python --version" register: python_version - - name: download get-pip.py - get_url: url=https://bootstrap.pypa.io/pip/2.7/get-pip.py dest=/tmp - when: '"2.7" in python_version.stdout' + - name: Print python version + debug: + var: python_version - - name: download get-pip.py + - name: download get-pip.py for python 2.7 + get_url: url=https://bootstrap.pypa.io/pip/2.7/get-pip.py dest=/tmp + when: '"2.7" in python_version.stderr' + + - name: download get-pip.py for ptython 2.6 get_url: url=https://bootstrap.pypa.io/pip/2.6/get-pip.py dest=/tmp - when: '"2.6" in python_version.stdout' + when: '"2.6" in python_version.stderr' - name: install pip become: true