Merge pull request #23730 from rallytime/bp-23729

Backport #23729 to 2014.7
This commit is contained in:
Thomas S Hatch 2015-05-14 15:58:34 -06:00
commit 2610195262

View File

@ -159,11 +159,18 @@ def item(*args, **kwargs):
salt '*' grains.item host sanitize=True
'''
ret = {}
for arg in args:
try:
ret[arg] = __grains__[arg]
except KeyError:
pass
default = kwargs.get('default', '')
delimiter = kwargs.get('delimiter', ':')
try:
for arg in args:
ret[arg] = salt.utils.traverse_dict_and_list(__grains__,
arg,
default,
delimiter)
except KeyError:
pass
if salt.utils.is_true(kwargs.get('sanitize')):
for arg, func in _SANITIZERS.items():
if arg in ret: