mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #14901 from Nibbler999/fix-custom-grains-override
Fix custom grains override
This commit is contained in:
commit
80a7c85b03
1 changed files with 8 additions and 8 deletions
|
@ -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…
Add table
Reference in a new issue