diff options
| author | Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> | 2019-12-05 12:40:05 +0100 |
|---|---|---|
| committer | Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> | 2019-12-05 14:48:05 +0100 |
| commit | df987c9d3fca40e0a7529e48a3626dfdd58e2168 (patch) | |
| tree | e01df923ff8df4b6240ae66723b498350a01759c /docker/macros.j2 | |
| parent | 324ea9e2baec0a135fc0096922ffd498fda53eeb (diff) | |
| download | kolla-df987c9d3fca40e0a7529e48a3626dfdd58e2168.tar.gz kolla-df987c9d3fca40e0a7529e48a3626dfdd58e2168.zip | |
Introduce macro to remove Py3 only plugins on CentOS 7
As CentOS 7 is Python 2 we need a way to remove plugins used in
OpenStack components once they switch to be Python 3 only.
'remove_py3_only_plugins_for_py2' macro does exactly that.
This change also disables networking-bgpvpn for python 2.
Change-Id: Ib90aabc485f1c831d3d41cc0f70052f8fffc3fe6
Related: blueprint drop-py2-support
Diffstat (limited to 'docker/macros.j2')
| -rw-r--r-- | docker/macros.j2 | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/docker/macros.j2 b/docker/macros.j2 index 8c698d278..f52ff2235 100644 --- a/docker/macros.j2 +++ b/docker/macros.j2 @@ -97,3 +97,13 @@ RUN usermod --append --home {{ homedir }} --groups kolla {{ name }} \ {{ enable_repos(repos) }} {% endmacro %} + +# NOTE(hrw): ending \ has to be at the end as we generate one line and there +# can be multiple plugins to remove +{% macro remove_py3_only_plugins_for_py2(plugins_to_remove) -%} + {% if distro_python_version == '2.7' -%} + {% for plugin in plugins_to_remove %}&& rm -rf /plugins/{{ plugin }}* {% endfor %} \ + {%- else -%} + \ + {%- endif %} +{%- endmacro %} |
