def show(config_file=False):
    '''
    Return a list of sysctl parameters for this minion

    config: Pull the data from the system configuration file
        instead of the live data.

    CLI Example:

    .. code-block:: bash

        salt '*' sysctl.show
    '''
    ret = {}
    if config_file:
        try:
            for line in salt.utils.fopen(config_file):
                if not line.startswith('#') and '=' in line:
                    # search if we have some '=' instead of ' = ' separators
                    SPLIT = ' = '
                    if SPLIT not in line:
                        SPLIT = SPLIT.strip()
                    key, value = line.split(SPLIT, 1)
                    key = key.strip()
                    value = value.lstrip()
                    ret[key] = value
        except (OSError, IOError):
            log.error('Could not open sysctl file')
            return None
    else:
        cmd = 'sysctl -a'
        out = __salt__['cmd.run_stdout'](cmd, output_loglevel='trace')
        for line in out.splitlines():
            if not line or ' = ' not in line:
                continue
            comps = line.split(' = ', 1)
            ret[comps[0]] = comps[1]
    return ret
dataset/ETHPy150Open saltstack/salt/salt/modules/linux_sysctl.py/show/original