Merge pull request #14901 from Nibbler999/fix-custom-grains-override

Fix custom grains override
This commit is contained in:
Thomas S Hatch 2014-08-13 10:35:26 -06:00
commit 80a7c85b03

View File

@ -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)