HEX
Server: Apache
System: Linux sg241.singhost.net 2.6.32-896.16.1.lve1.4.51.el6.x86_64 #1 SMP Wed Jan 17 13:19:23 EST 2018 x86_64
User: honghock (909)
PHP: 8.0.30
Disabled: passthru,system,shell_exec,show_source,exec,popen,proc_open
Upload Files
File: //proc/self/root/usr/lib/python2.7/site-packages/salt/runners/config.py
# -*- coding: utf-8 -*-
'''
This runner is designed to mirror the execution module config.py, but for
master settings
'''
from __future__ import absolute_import, print_function, unicode_literals

import salt.utils.data
import salt.utils.sdb


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
        salt-run config.get file_roots:base
        salt-run config.get file_roots,base delimiter=','
    '''
    ret = salt.utils.data.traverse_dict_and_list(__opts__, key, default='_|-', delimiter=delimiter)
    if ret == '_|-':
        return default
    else:
        return salt.utils.sdb.sdb_get(ret, __opts__)