Skip to content

Commit 30fbbad

Browse files
committed
Restore use of contextfunction decorator
This code supporting Jinja2<3 was originally using the contextfunction decorator rather than contextfilter. Although they are both replaced by pass_context, the old decorators are different. This resolves the following issue seen in kayobe CI: TypeError: handle_repos() missing 1 required positional argument: 'mode' This was only noticed with kayobe because it uses upper constraints to install kolla. Change-Id: Ie4bccb9ed3f4d8782730c5929abbfa73da215a8c
1 parent 4ac3ae7 commit 30fbbad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kolla/template/methods.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
import os
1616
import yaml
1717

18-
# NOTE: jinja2 3.1.0 dropped contextfilter in favour of pass_context.
18+
# NOTE: jinja2 3.1.0 dropped contextfunction in favour of pass_context.
1919
try:
2020
from jinja2 import pass_context
2121
except ImportError:
22-
from jinja2 import contextfilter as pass_context
22+
from jinja2 import contextfunction as pass_context
2323

2424

2525
def debian_package_install(packages, clean_package_cache=True):

0 commit comments

Comments
 (0)