From 0c8cb6890e6e3ff7b35e36f65cac537a6dcbb87a Mon Sep 17 00:00:00 2001 From: jeanluc Date: Thu, 30 May 2024 21:43:16 +0200 Subject: [PATCH] Fix accessing wrappers in Jinja templates via attributes --- changelog/66600.fixed.md | 1 + salt/client/ssh/wrapper/__init__.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog/66600.fixed.md diff --git a/changelog/66600.fixed.md b/changelog/66600.fixed.md new file mode 100644 index 00000000000..c3db4e1263e --- /dev/null +++ b/changelog/66600.fixed.md @@ -0,0 +1 @@ +Fixed accessing wrapper modules in Salt-SSH Jinja templates via attribute syntax diff --git a/salt/client/ssh/wrapper/__init__.py b/salt/client/ssh/wrapper/__init__.py index cfa977be0f0..6215e4eb67a 100644 --- a/salt/client/ssh/wrapper/__init__.py +++ b/salt/client/ssh/wrapper/__init__.py @@ -139,7 +139,7 @@ class FunctionWrapper: ): super().__init__() self.cmd_prefix = cmd_prefix - self.wfuncs = wfuncs if isinstance(wfuncs, dict) else {} + self.wfuncs = wfuncs if wfuncs is not None else {} self.opts = opts self.mods = mods if isinstance(mods, dict) else {} self.kwargs = {"id_": id_, "host": host}