mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Add config.get runner function
This commit is contained in:
parent
f7b062acd7
commit
5e8f92ef70
34
salt/runners/config.py
Normal file
34
salt/runners/config.py
Normal file
@ -0,0 +1,34 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
This runner is designed to mirror the execution module config.py, but for
|
||||
master settings
|
||||
'''
|
||||
from __future__ import absolute_import
|
||||
from __future__ import print_function
|
||||
|
||||
import salt.utils
|
||||
|
||||
|
||||
def get(key, default='', delimiter=':'):
|
||||
'''
|
||||
Retrieve master config options, with optional nesting via the delimiter
|
||||
argument.
|
||||
|
||||
**Arguments**
|
||||
|
||||
default
|
||||
|
||||
If the key is not found, the default will be returned instead
|
||||
|
||||
delimiter
|
||||
|
||||
Override the delimiter used to separate nested levels of a data
|
||||
structure.
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt-run config.get gitfs_remotes
|
||||
'''
|
||||
return salt.utils.traverse_dict_and_list(__opts__, key, delimiter=delimiter)
|
Loading…
Reference in New Issue
Block a user