mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge pull request #23730 from rallytime/bp-23729
Backport #23729 to 2014.7
This commit is contained in:
commit
2610195262
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user