From 36d8612ac0fdd9735f0f17b7de17370235a6be6f Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Thu, 19 Jan 2017 10:54:26 -0800 Subject: [PATCH] Use jinja2 import instead of pip to get version. This resolves issues with older versions of pip. (cherry picked from commit a8fb6f0958704c2f6d5b1be776423dc6263a82cf) --- test/integration/roles/test_filters/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/roles/test_filters/tasks/main.yml b/test/integration/roles/test_filters/tasks/main.yml index 2899cc4a77b..7b54d458985 100644 --- a/test/integration/roles/test_filters/tasks/main.yml +++ b/test/integration/roles/test_filters/tasks/main.yml @@ -78,5 +78,5 @@ - "'local' == ['localhost']|map('extract',hostvars,'ansible_connection')|list|first" - "'local' == ['localhost']|map('extract',hostvars,['ansible_connection'])|list|first" # map was added to jinja2 in version 2.7 - when: "{{ ( lookup('pipe', 'pip show --disable-pip-version-check jinja2 | grep ^Version: | sed \"s/^Version: //\"') | + when: "{{ ( lookup('pipe', '{{ ansible_python[\"executable\"] }} -c \"import jinja2; print(jinja2.__version__)\"') | version_compare('2.7', '>=') ) }}"