From b9d90b5e81bcb27766bec04bb6f3794078506f82 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Fri, 20 Apr 2018 13:03:56 +0100 Subject: [PATCH] Ensure that pip.conf templates variables properly When a user provides values other than the defaults for upgrade/pre, they may not format it in a way that pip interprets properly. To ensure that we template the conf file correctly, we ensure that it's interpreted as a boolean, then make it lower case as is expected by pip. Change-Id: I91590665cd2d878b6b5ef92d1118610bb4a3fd84 --- templates/pip.conf.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/pip.conf.j2 b/templates/pip.conf.j2 index 9b94138..07dd9c0 100644 --- a/templates/pip.conf.j2 +++ b/templates/pip.conf.j2 @@ -13,9 +13,9 @@ trusted-host = {% endif %} [install] -upgrade = {{ pip_upgrade }} +upgrade = {{ (pip_upgrade | bool) | lower }} upgrade-strategy = {{ pip_upgrade_strategy }} -pre = {{ pip_enable_pre_releases }} +pre = {{ (pip_enable_pre_releases | bool) | lower }} {% if pip_links | length > 0 %} find-links = {% for pip_link in pip_links %}