示例#1
0
文件: be.py 项目: google/turbinia
  def run(results):
    """Celery task that reduces the results into one SQLite database.

    Args:
        results: List of returned values from Celery tasks.
    Returns:
        Task result object (instance of TurbiniaTaskResult) as JSON.
    """
    job_id = results[0]
    cmd_output = subprocess.check_output(
        ['/usr/local/bin/be_reducer.sh', job_id])
    result = TurbiniaTaskResult()
    result.add_result(result_type='PATH', result=cmd_output)
    return result.to_json()
示例#2
0
    def run(results):
        """Celery task that reduces the results into one SQLite database.

    Args:
        results: List of returned values from Celery tasks.
    Returns:
        Task result object (instance of TurbiniaTaskResult) as JSON.
    """
        job_id = results[0]
        cmd_output = subprocess.check_output(
            ['/usr/local/bin/be_reducer.sh', job_id])
        result = TurbiniaTaskResult()
        result.add_result(result_type='PATH', result=cmd_output)
        return result.to_json()
示例#3
0
    def run(src_path, out_path, job_id, **kwargs):
        """Task that process data with Plaso.

        Args:
            src_path: Path to data to process.
            out_path: Path to temporary storage of results.
            job_id: Unique ID for this task.

        Returns:
            Task result object (instance of TurbiniaTaskResult) as JSON.
        """
        out_path = "{0:s}/{1:s}".format(out_path, job_id)
        if not os.path.exists(out_path):
            os.makedirs(out_path)
        cmd_output = subprocess.check_output(["/usr/local/bin/plaso_wrapper.sh", src_path, out_path, job_id])
        res, version, metadata = cmd_output.split(" ", 2)
        result = TurbiniaTaskResult(version=version, metadata=json.loads(metadata))
        result.add_result(result_type="PATH", result=res)
        return result.to_json()
示例#4
0
    def run(src_path, out_path, job_id, **kwargs):
        """Task that process data with Plaso.

    Args:
        src_path: Path to data to process.
        out_path: Path to temporary storage of results.
        job_id: Unique ID for this task.

    Returns:
        Task result object (instance of TurbiniaTaskResult) as JSON.
    """
        out_path = '{0:s}/{1:s}'.format(out_path, job_id)
        if not os.path.exists(out_path):
            os.makedirs(out_path)
        cmd_output = subprocess.check_output(
            ['/usr/local/bin/plaso_wrapper.sh', src_path, out_path, job_id])
        res, version, metadata = cmd_output.split(' ', 2)
        result = TurbiniaTaskResult(version=version,
                                    metadata=json.loads(metadata))
        result.add_result(result_type='PATH', result=res)
        return result.to_json()