summaryrefslogtreecommitdiff
path: root/test/runner/lib/executor.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/runner/lib/executor.py')
-rw-r--r--test/runner/lib/executor.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/test/runner/lib/executor.py b/test/runner/lib/executor.py
index b760832945..848cb3adc6 100644
--- a/test/runner/lib/executor.py
+++ b/test/runner/lib/executor.py
@@ -156,11 +156,16 @@ def install_command_requirements(args):
try:
run_command(args, cmd)
- except SubprocessError:
- # Gundalow/Mattclay: Revisit logic here https://github.com/ansible/ansible/issues/32398
- # If the install fails for any reason, upgrade pip and retry.
- # We don't wish to unconditionally upgrade pip, as that would reduce test coverage
+ except SubprocessError as ex:
+ if ex.status != 2:
+ raise
+
+ # If pip is too old it won't understand the arguments we passed in, so we'll need to upgrade it.
+ # Installing "coverage" on ubuntu 16.04 fails with the error:
+ # AttributeError: 'Requirement' object has no attribute 'project_name'
+ # See: https://bugs.launchpad.net/ubuntu/xenial/+source/python-pip/+bug/1626258
+ # Upgrading pip works around the issue.
run_command(args, ['pip', 'install', '--upgrade', 'pip'])
run_command(args, cmd)