mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Add dot_vals function to config.py
This commit is contained in:
parent
8d6bf4af73
commit
3abf7ff47e
@ -67,3 +67,18 @@ def option(value):
|
||||
elif value in defaults:
|
||||
return defaults[value]
|
||||
return ''
|
||||
|
||||
|
||||
def dot_vals(value):
|
||||
'''
|
||||
Pass in a configuration value that should be preceeded by the module name
|
||||
and a dot, this will return a list of all read key/value pairs
|
||||
'''
|
||||
ret = {}
|
||||
for key, val in __pillar__.get('master', {}).items():
|
||||
if key.startswith('{0}.'.format(value)):
|
||||
ret[key] = val
|
||||
for key, val in __opts__.items():
|
||||
if key.startswith('{0}.'.format(value)):
|
||||
ret[key] = val
|
||||
return ret
|
||||
|
Loading…
Reference in New Issue
Block a user