Reloads syslog-ng. This function is intended to be used from states.

    If :mod:`syslog_ng.set_config_file
    <salt.modules.syslog_ng.set_binary_path>`, is called before, this function
    will use the set binary path.

    CLI Example:

    .. code-block:: bash

        salt '*' syslog_ng.reload

def reload_(name):
    '''
    Reloads syslog-ng. This function is intended to be used from states.

    If :mod:`syslog_ng.set_config_file
    <salt.modules.syslog_ng.set_binary_path>`, is called before, this function
    will use the set binary path.

    CLI Example:

    .. code-block:: bash

        salt '*' syslog_ng.reload

    '''
    if __SYSLOG_NG_BINARY_PATH:
        syslog_ng_ctl_binary = os.path.join(__SYSLOG_NG_BINARY_PATH,
                                            'syslog-ng-ctl')
        command = [syslog_ng_ctl_binary, 'reload']
        result = __salt__['cmd.run_all'](command, python_shell=False)
    else:
        command = ['syslog-ng-ctl', 'reload']
        result = __salt__['cmd.run_all'](command, python_shell=False)

    succ = True if result['retcode'] == 0 else False
    return _format_state_result(name, result=succ, comment=result['stdout'])