* use traverse_dict_and_list() in modules.config

This commit is contained in:
panying 2014-06-14 14:26:28 +08:00
parent b4ab86cfdc
commit 2daff27ea6

View File

@ -224,16 +224,16 @@ def get(key, default=''):
salt '*' config.get pkg:apache salt '*' config.get pkg:apache
''' '''
ret = salt.utils.traverse_dict(__opts__, key, '_|-') ret = salt.utils.traverse_dict_and_list(__opts__, key, '_|-')
if ret != '_|-': if ret != '_|-':
return ret return ret
ret = salt.utils.traverse_dict(__grains__, key, '_|-') ret = salt.utils.traverse_dict_and_list(__grains__, key, '_|-')
if ret != '_|-': if ret != '_|-':
return ret return ret
ret = salt.utils.traverse_dict(__pillar__, key, '_|-') ret = salt.utils.traverse_dict_and_list(__pillar__, key, '_|-')
if ret != '_|-': if ret != '_|-':
return ret return ret
ret = salt.utils.traverse_dict(__pillar__.get('master', {}), key, '_|-') ret = salt.utils.traverse_dict_and_list(__pillar__.get('master', {}), key, '_|-')
if ret != '_|-': if ret != '_|-':
return ret return ret
return default return default