From 451287e1c6c3f6306c350dfdb2019b573604b902 Mon Sep 17 00:00:00 2001 From: Mircea Ulinic Date: Wed, 15 Aug 2018 08:32:20 +0000 Subject: [PATCH] Allow the __utils__ dunder in Grains modules --- salt/loader.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/salt/loader.py b/salt/loader.py index fe731bc87352..6b9055834911 100644 --- a/salt/loader.py +++ b/salt/loader.py @@ -674,7 +674,7 @@ def grain_funcs(opts, proxy=None): __opts__ = salt.config.minion_config('/etc/salt/minion') grainfuncs = salt.loader.grain_funcs(__opts__) ''' - return LazyLoader( + ret = LazyLoader( _module_dirs( opts, 'grains', @@ -684,6 +684,8 @@ def grain_funcs(opts, proxy=None): opts, tag='grains', ) + ret.pack['__utils__'] = utils(opts, proxy=proxy) + return ret def _load_cached_grains(opts, cfn):