Exemplo n.º 1
0
def upsert_all(sender, obj=None, src=None, service=None, event=None):  # noqa  # pylint: disable=unused-argument
  """Update snapshots globally"""
  snapshot_settings = src.get("snapshots")
  if snapshot_settings:
    if snapshot_settings["operation"] == "upsert":
      revisions = {
          (Stub.from_dict(revision["parent"]),
           Stub.from_dict(revision["child"])): revision["revision_id"]
          for revision in snapshot_settings.get("revisions", {})}
      upsert_snapshots(obj, event, revisions=revisions)
Exemplo n.º 2
0
def upsert_all(sender, obj=None, src=None, service=None, event=None):  # noqa  # pylint: disable=unused-argument
    """Update snapshots globally"""
    snapshot_settings = src.get("snapshots")
    if snapshot_settings:
        if snapshot_settings["operation"] == "upsert":
            revisions = {
                (Stub.from_dict(revision["parent"]),
                 Stub.from_dict(revision["child"])): revision["revision_id"]
                for revision in snapshot_settings.get("revisions", {})
            }
            upsert_snapshots(obj, event, revisions=revisions)
Exemplo n.º 3
0
def upsert_all(
    sender, obj=None, src=None, service=None,
    event=None, initial_state=None):  # noqa
  """Updates snapshots globally."""
  del sender, service, initial_state  # Unused
  snapshot_settings = src.get("snapshots")
  if snapshot_settings:
    if snapshot_settings["operation"] == "upsert":
      revisions = {
          (Stub.from_dict(revision["parent"]),
           Stub.from_dict(revision["child"])): revision["revision_id"]
          for revision in snapshot_settings.get("revisions", {})}
      upsert_snapshots(obj, event, revisions=revisions)
Exemplo n.º 4
0
def upsert_all(
    sender, obj=None, src=None, service=None,
    event=None, initial_state=None):  # noqa
  """Updates snapshots globally."""
  del sender, service, initial_state  # Unused
  snapshot_settings = src.get("snapshots")
  if snapshot_settings:
    if snapshot_settings["operation"] == "upsert":
      revisions = {
          (Stub.from_dict(revision["parent"]),
           Stub.from_dict(revision["child"])): revision["revision_id"]
          for revision in snapshot_settings.get("revisions", {})}
      upsert_snapshots(obj, event, revisions=revisions)