def _run_command_in_extended_path(syslog_ng_sbin_dir, command, params):
    orig_path = _add_to_path_envvar(syslog_ng_sbin_dir)

    if not salt.utils.which(command):
        error_message = (
            'Unable to execute the command \'{0}\'. It is not in the PATH.'
            .format(command)
        )
        log.error(error_message)
        _restore_path_envvar(orig_path)
        raise CommandExecutionError(error_message)

    ret = _run_command(command, options=params)
    _restore_path_envvar(orig_path)
    return ret
Runs the given command in an environment, where the syslog_ng_sbin_dir is
dataset/ETHPy150Open saltstack/salt/salt/modules/syslog_ng.py/_run_command_in_extended_path