mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #14901 from Nibbler999/fix-custom-grains-override
Fix custom grains override
This commit is contained in:
commit
80a7c85b03
@ -1206,7 +1206,14 @@ class Loader(object):
|
||||
grains_data = {}
|
||||
funcs = self.gen_functions()
|
||||
for key, fun in funcs.items():
|
||||
if key[key.index('.') + 1:] == 'core':
|
||||
if not key.startswith('core.'):
|
||||
continue
|
||||
ret = fun()
|
||||
if not isinstance(ret, dict):
|
||||
continue
|
||||
grains_data.update(ret)
|
||||
for key, fun in funcs.items():
|
||||
if key.startswith('core.'):
|
||||
continue
|
||||
try:
|
||||
ret = fun()
|
||||
@ -1222,13 +1229,6 @@ class Loader(object):
|
||||
if not isinstance(ret, dict):
|
||||
continue
|
||||
grains_data.update(ret)
|
||||
for key, fun in funcs.items():
|
||||
if key[key.index('.') + 1:] != 'core':
|
||||
continue
|
||||
ret = fun()
|
||||
if not isinstance(ret, dict):
|
||||
continue
|
||||
grains_data.update(ret)
|
||||
# Write cache if enabled
|
||||
if self.opts.get('grains_cache', False):
|
||||
cumask = os.umask(077)
|
||||
|
Loading…
Reference in New Issue
Block a user