From 6316419e7517757796c1566e910fd8cdd4063a04 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Sun, 20 Aug 2023 23:12:34 +0200 Subject: [PATCH] added saltclass diff file --- misc/saltclass.py.diff | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 misc/saltclass.py.diff diff --git a/misc/saltclass.py.diff b/misc/saltclass.py.diff new file mode 100644 index 0000000..7bfca2a --- /dev/null +++ b/misc/saltclass.py.diff @@ -0,0 +1,33 @@ +--- /tmp/saltclass.py 2023-08-13 11:32:29.466897018 +0200 ++++ /usr/local/lib/python3.11/dist-packages/salt/tops/saltclass.py 2023-05-12 19:53:57.812134308 +0200 +@@ -210,9 +210,12 @@ + + import logging + ++import salt.config ++import salt.loader + import salt.utils.saltclass as sc + + log = logging.getLogger(__name__) ++__salt__ = None + + + def __virtual__(): +@@ -220,6 +223,8 @@ + Only run if properly configured + """ + if __opts__["master_tops"].get("saltclass"): ++ global __salt__ ++ __salt__ = salt.loader.minion_mods(__opts__) + return True + return False + +@@ -258,7 +263,7 @@ + + salt_data = { + "__opts__": kwargs["opts"], +- "__salt__": {}, ++ "__salt__": __salt__, + "__grains__": kwargs["grains"], + "__pillar__": {}, + "minion_id": minion_id,