From e2c43b206e0a2ad47505805f3dc8841adeb3bb51 Mon Sep 17 00:00:00 2001
From: Paul Bourke <paul.bourke@oracle.com>
Date: Thu, 20 Oct 2016 16:04:28 +0100
Subject: [PATCH] Allow operators to customise pip in kolla-toolbox

Closes-Bug: #1635304

Change-Id: I6535e3240695458ed04c8750fe34e772a3b2ede3
---
 docker/kolla-toolbox/Dockerfile.j2            | 19 +++++++++++--------
 ...ustomise-toolbox-pip-e574c422afae0d93.yaml |  4 ++++
 2 files changed, 15 insertions(+), 8 deletions(-)
 create mode 100644 releasenotes/notes/customise-toolbox-pip-e574c422afae0d93.yaml

diff --git a/docker/kolla-toolbox/Dockerfile.j2 b/docker/kolla-toolbox/Dockerfile.j2
index 78b0a6cbde..cbb495ac3a 100644
--- a/docker/kolla-toolbox/Dockerfile.j2
+++ b/docker/kolla-toolbox/Dockerfile.j2
@@ -48,16 +48,19 @@ MAINTAINER {{ maintainer }}
 {% endif %}
 {{ macros.install_packages(kolla_toolbox_packages | customizable("packages")) }}
 
+{% block kolla_toolbox_source_install_python_pip %}
 RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
     && python get-pip.py \
-    && rm get-pip.py \
-    && pip --no-cache-dir install pytz \
-    && pip --no-cache-dir install \
-        ansible==2.1.1.0 \
-        MySQL-python \
-        os-client-config==1.16.0 \
-        pyudev \
-        shade==1.5.0
+    && rm get-pip.py
+{% endblock %}
+
+RUN pip --no-cache-dir install \
+    pytz \
+    ansible==2.1.1.0 \
+    MySQL-python \
+    os-client-config==1.16.0 \
+    pyudev \
+    shade==1.5.0
 
 RUN useradd -m --user-group ansible --groups kolla \
     && mkdir -p /etc/ansible /usr/share/ansible \
diff --git a/releasenotes/notes/customise-toolbox-pip-e574c422afae0d93.yaml b/releasenotes/notes/customise-toolbox-pip-e574c422afae0d93.yaml
new file mode 100644
index 0000000000..f6b0dad484
--- /dev/null
+++ b/releasenotes/notes/customise-toolbox-pip-e574c422afae0d93.yaml
@@ -0,0 +1,4 @@
+---
+features:
+  - Allow operators to customise the installation of pip
+    within kolla-toolbox.