From 383364e671fb82e3c0ddca37a4690a1a33be3b54 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Mon, 28 Jun 2021 10:36:39 +0200 Subject: Update code to Jinja 3.0 style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Xena cycle uses Jinja 3.0 so let update Kolla's code for it. From Jinja2 documentation: jinja2.contextfunction(f: F) → F Pass the context as the first argument to the decorated function. Deprecated since version 3.0: Will be removed in Jinja 3.1. Use pass_context() instead. jinja2.contextfilter(f) Pass the context as the first argument to the decorated function. Deprecated since version 3.0: Will be removed in Jinja 3.1. Use pass_context() instead. Also bumped version in requirements.txt to same as in openstack/requirements Change-Id: I51fbb7b9ff7c29cb355437efa4576be9bc035699 --- kolla/template/methods.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'kolla/template/methods.py') diff --git a/kolla/template/methods.py b/kolla/template/methods.py index 19fcf4e22..69434ef50 100644 --- a/kolla/template/methods.py +++ b/kolla/template/methods.py @@ -15,7 +15,7 @@ import os import yaml -from jinja2 import contextfunction +from jinja2 import pass_context def debian_package_install(packages, clean_package_cache=True): @@ -71,7 +71,7 @@ def debian_package_install(packages, clean_package_cache=True): return ' && '.join(cmds) -@contextfunction +@pass_context def handle_repos(context, reponames, mode): """NOTE(hrw): we need to handle CentOS, Debian and Ubuntu with one macro. -- cgit v1.2.3