def WriteComponent(name="grr-rekall", version="0.3", modules=None, token=None,
                   raw_data=""):
  components_base = "grr.client.components.rekall_support."
  if modules is None:
    # For tests we load the component from the source tree directly. This is
    # because tests aready include the component compiled in and so do not need
    # to pack and unpack it.
    modules = [components_base + "grr_rekall"]
  result = rdf_client.ClientComponent(raw_data=raw_data)
  result.build_system = result.build_system.FromCurrentSystem()
  result.summary.modules = modules
  result.summary.name = name
  result.summary.version = version
  result.summary.cipher.SetAlgorithm("AES128CBC")

  with utils.TempDirectory() as tmp_dir:
    with open(os.path.join(tmp_dir, "component"), "wb") as fd:
      fd.write(result.SerializeToString())

    return maintenance_utils.SignComponent(fd.name, token=token)
Closes the file-like object.
dataset/ETHPy150Open google/grr/grr/lib/test_lib.py/WriteComponent--crossover with--dataset/ETHPy150Open log2timeline/dfvfs/dfvfs/file_io/os_file_io.py/OSFile._Close