Fix installation errors with Python 2

Python 2 jobs recently started failing frequently with the following
error:

    distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pbr>=2.0.0')

The root cause appears to be that indirect requirements are handled by
easy_install which doesn't like some index servers [1]. Try updating
setuptools first.

[1] https://github.com/googleapis/google-cloud-python/issues/3757#issuecomment-422384453

Change-Id: I95303e52f2b462ceda21abaa4097cc9291362d33
This commit is contained in:
Pierre Riteau 2021-04-09 15:58:53 +02:00
parent b53afa660b
commit 437c6a1e30

View File

@ -162,6 +162,15 @@
state: directory
become: true
# Workaround for distutils.errors.DistutilsError: Could not find suitable
# distribution for Requirement.parse('pbr>=2.0.0') in the next task
- name: ensure setuptools is updated
pip:
name: "setuptools"
executable: "pip{{ playbook_python_version }}"
extra_args: "-c {{ upper_constraints_file }} --user"
state: latest
- name: install kolla-ansible and dependencies
vars:
# Test latest ansible version on Ubuntu and CentOS 8, minimum supported on others.