diff options
Diffstat (limited to 'app-admin/salt/files/salt-3003.3-jinja.patch')
-rw-r--r-- | app-admin/salt/files/salt-3003.3-jinja.patch | 155 |
1 files changed, 0 insertions, 155 deletions
diff --git a/app-admin/salt/files/salt-3003.3-jinja.patch b/app-admin/salt/files/salt-3003.3-jinja.patch deleted file mode 100644 index ec5b1ac6156f..000000000000 --- a/app-admin/salt/files/salt-3003.3-jinja.patch +++ /dev/null @@ -1,155 +0,0 @@ -https://github.com/saltstack/salt/issues/61848 -https://patch-diff.githubusercontent.com/raw/saltstack/salt/pull/61856.patch - -Dropped a bunch of irrelevant hunks (CI files and a test not in 3003.3) - -From 03c2a607a0722ad5e55b6c8f8eda630be7c7fee5 Mon Sep 17 00:00:00 2001 -From: jonyhy96 <hy352144278@gmail.com> -Date: Thu, 10 Mar 2022 10:41:48 +0800 -Subject: [PATCH 1/5] fix: jinja2 contextfuntion base on version - ---- - salt/utils/jinja.py | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/salt/utils/jinja.py b/salt/utils/jinja.py -index 4c430b5ccf32..9a1938c2d69b 100644 ---- a/salt/utils/jinja.py -+++ b/salt/utils/jinja.py -@@ -707,7 +707,11 @@ def method_call(obj, f_name, *f_args, **f_kwargs): - return getattr(obj, f_name, lambda *args, **kwargs: None)(*f_args, **f_kwargs) - - --@jinja2.contextfunction -+if jinja2.__version__ < '3.0.0' : -+ contextfunction = jinja2.contextfunction -+else: -+ contextfunction = jinja2.pass_context -+@contextfunction - def show_full_context(ctx): - return salt.utils.data.simple_types_filter( - {key: value for key, value in ctx.items()} - -From 1aba938021b86732a211a899dc4c2a46afa488a2 Mon Sep 17 00:00:00 2001 -From: jonyhy96 <hy352144278@gmail.com> -Date: Thu, 3 Mar 2022 16:21:17 +0800 -Subject: [PATCH 2/5] fix: jinja2 DeprecationWarning - ---- - salt/utils/jinja.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/salt/utils/jinja.py b/salt/utils/jinja.py -index 9a1938c2d69b..207a2cb77035 100644 ---- a/salt/utils/jinja.py -+++ b/salt/utils/jinja.py -@@ -710,7 +710,7 @@ def method_call(obj, f_name, *f_args, **f_kwargs): - if jinja2.__version__ < '3.0.0' : - contextfunction = jinja2.contextfunction - else: -- contextfunction = jinja2.pass_context -+ contextfunction = jinja2.pass_context - @contextfunction - def show_full_context(ctx): - return salt.utils.data.simple_types_filter( - -From 7f281bbfc8efda40cfe7d607c0ddebb2fb00bd5d Mon Sep 17 00:00:00 2001 -From: Megan Wilhite <mwilhite@vmware.com> -Date: Fri, 25 Mar 2022 08:31:24 -0600 -Subject: [PATCH 3/5] Use the correct Markup from jinja for each version - ---- - salt/utils/jinja.py | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/salt/utils/jinja.py b/salt/utils/jinja.py -index 207a2cb77035..558f063d7206 100644 ---- a/salt/utils/jinja.py -+++ b/salt/utils/jinja.py -@@ -26,7 +26,7 @@ - import salt.utils.stringutils - import salt.utils.url - import salt.utils.yaml --from jinja2 import BaseLoader, Markup, TemplateNotFound, nodes -+from jinja2 import BaseLoader, TemplateNotFound, nodes - from jinja2.environment import TemplateModule - from jinja2.exceptions import TemplateRuntimeError - from jinja2.ext import Extension -@@ -35,6 +35,12 @@ - from salt.utils.odict import OrderedDict - from salt.utils.versions import LooseVersion - -+try: -+ from jinja2 import Markup -+except ImportError: -+ # Markup moved to markupsafe in jinja>= 3.1 -+ from markupsafe import Markup -+ - log = logging.getLogger(__name__) - - __all__ = ["SaltCacheLoader", "SerializerExtension"] - -diff --git a/salt/utils/jinja.py b/salt/utils/jinja.py -index 558f063d7206..5d00b134e25f 100644 ---- a/salt/utils/jinja.py -+++ b/salt/utils/jinja.py -@@ -713,10 +713,12 @@ def method_call(obj, f_name, *f_args, **f_kwargs): - return getattr(obj, f_name, lambda *args, **kwargs: None)(*f_args, **f_kwargs) - - --if jinja2.__version__ < '3.0.0' : -+if jinja2.__version__ < "3.0.0": - contextfunction = jinja2.contextfunction - else: - contextfunction = jinja2.pass_context -+ -+ - @contextfunction - def show_full_context(ctx): - return salt.utils.data.simple_types_filter( - -From 9056e636beaea7de2e3a61876ba0345e5d390973 Mon Sep 17 00:00:00 2001 -From: Megan Wilhite <mwilhite@vmware.com> -Date: Fri, 25 Mar 2022 11:14:01 -0600 -Subject: [PATCH 5/5] Fix requested feedback - ---- - requirements/static/ci/docs.in | 1 + - requirements/static/ci/py3.10/docs.txt | 3 ++- - requirements/static/ci/py3.6/docs.txt | 1 + - requirements/static/ci/py3.7/docs.txt | 3 ++- - requirements/static/ci/py3.8/docs.txt | 3 ++- - requirements/static/ci/py3.9/docs.txt | 3 ++- - salt/utils/jinja.py | 10 +++++----- - 8 files changed, 21 insertions(+), 10 deletions(-) - -diff --git a/salt/utils/jinja.py b/salt/utils/jinja.py -index 5d00b134e25f..aa8ebe90546c 100644 ---- a/salt/utils/jinja.py -+++ b/salt/utils/jinja.py -@@ -36,10 +36,10 @@ - from salt.utils.versions import LooseVersion - - try: -- from jinja2 import Markup --except ImportError: -- # Markup moved to markupsafe in jinja>= 3.1 - from markupsafe import Markup -+except ImportError: -+ # jinja < 3.1 -+ from jinja2 import Markup - - log = logging.getLogger(__name__) - -@@ -713,9 +713,9 @@ def method_call(obj, f_name, *f_args, **f_kwargs): - return getattr(obj, f_name, lambda *args, **kwargs: None)(*f_args, **f_kwargs) - - --if jinja2.__version__ < "3.0.0": -+try: - contextfunction = jinja2.contextfunction --else: -+except AttributeError: - contextfunction = jinja2.pass_context - - |