grr/server/grr_response_server/databases/migration.py
def _MigrateArtifact(artifact, overwrite):
  """Migrate one Artifact from AFF4 to REL_DB."""
  name = Text(artifact.name)

  try:
    logging.info("Migating %s", name)
    data_store.REL_DB.WriteArtifact(artifact)
    logging.info("  Wrote %s", name)
  except db.DuplicatedArtifactError:
    if overwrite:
      data_store.REL_DB.DeleteArtifact(name)
      data_store.REL_DB.WriteArtifact(artifact)
      logging.info("  Overwrote %s", name)
    else:
      logging.info("  Skipped %s, because artifact already exists.", name)
Migrate one Artifact from AFF4 to REL_DB.
Migrate one Artifact from AFF4 to REL_DB.
Migrate one Artifact from AFF4 to REL_DB .
def _MigrateArtifact(artifact, overwrite):
  name = Text(artifact.name)
  try:
    logging.info("Migating %s", name)
    data_store.REL_DB.WriteArtifact(artifact)
    logging.info("  Wrote %s", name)
  except db.DuplicatedArtifactError:
    if overwrite:
      data_store.REL_DB.DeleteArtifact(name)
      data_store.REL_DB.WriteArtifact(artifact)
      logging.info("  Overwrote %s", name)
    else:
      logging.info("  Skipped %s, because artifact already exists.", name)
def _MigrateArtifact ( artifact , overwrite ) : name = Text ( artifact . name ) try : logging . info ( "Migating %s" , name ) data_store . REL_DB . WriteArtifact ( artifact ) logging . info ( "  Wrote %s" , name ) except db . DuplicatedArtifactError : if overwrite : data_store . REL_DB . DeleteArtifact ( name ) data_store . REL_DB . WriteArtifact ( artifact ) logging . info ( "  Overwrote %s" , name ) else : logging . info ( "  Skipped %s, because artifact already exists." , name )
Migrate one Artifact from AFF4 to REL_DB.
Migrate one Artifact from AFF4 to REL_DB .
"""Migrate one Artifact from AFF4 to REL_DB."""
artifact
overwrite