summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2022-03-28 15:42:45 +0000
committerGerrit Code Review <review@openstack.org>2022-03-28 15:42:45 +0000
commitc572fc61d02071a4fc5a950d12b783e9b8a998ae (patch)
tree0776764f37c0f6a15d1e5fa07fe12a986694a102
parentac371617c9f124e9115ad8112020254477e11f24 (diff)
parent16c230fb114d81a2a09187580875f8b9959ab8d4 (diff)
downloadkolla-c572fc61d02071a4fc5a950d12b783e9b8a998ae.tar.gz
kolla-c572fc61d02071a4fc5a950d12b783e9b8a998ae.zip
Merge "Revert "Revert "Update code to Jinja 3.0 style"""
-rw-r--r--kolla/template/filters.py4
-rw-r--r--kolla/template/methods.py4
-rw-r--r--requirements.txt2
3 files changed, 5 insertions, 5 deletions
diff --git a/kolla/template/filters.py b/kolla/template/filters.py
index 49708ee3f..3f2ede956 100644
--- a/kolla/template/filters.py
+++ b/kolla/template/filters.py
@@ -12,11 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from jinja2 import contextfilter
+from jinja2 import pass_context
from jinja2 import Undefined
-@contextfilter
+@pass_context
def customizable(context, val_list, call_type):
# NOTE(mgoddard): Don't try to customise undefined values. There are cases
# where this might happen, for example using a generic template overrides
diff --git a/kolla/template/methods.py b/kolla/template/methods.py
index 420a70306..4426512bb 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.
diff --git a/requirements.txt b/requirements.txt
index 9d5bd1cf3..7d1c0d9db 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
pbr!=2.1.0,>=2.0.0 # Apache-2.0
docker>=2.4.2 # Apache-2.0
-Jinja2>=2.8 # BSD License (3 clause)
+Jinja2>=3.0.1 # BSD License (3 clause)
GitPython>=1.0.1 # BSD License (3 clause)
oslo.config>=5.1.0 # Apache-2.0