'Takes in an OVO and generates an event on relevant changes.
A change is deemed to be relevant if it is not stale and if any
fields changed beyond the revision number and update time.
Both creates and updates are handled in this function.'

def record_resource_update(self, context, rtype, resource):

    if self._is_stale(rtype, resource):
        LOG.debug('Ignoring    stale    update    for    %s:    %s', rtype, resource)
        return
    existing = self._type_cache(rtype).get(resource.id)
    self._type_cache(rtype)[resource.id] = resource
    changed_fields = self._get_changed_fields(existing, resource)
    if (not changed_fields):
        LOG.debug('Received    resource    %s    update    without    any    changes:    %s', rtype, resource.id)
        return
    if existing:
        LOG.debug('Resource    %s    %s    updated    (revision_number    %s->%s).    Old    fields:    %s    New    fields:    %s', rtype, existing.id, existing.revision_number, resource.revision_number, {f: existing.get(f) for f in changed_fields}, {f: resource.get(f) for f in changed_fields})
    else:
        LOG.debug('Received    new    resource    %s:    %s', rtype, resource)
    registry.notify(rtype, events.AFTER_UPDATE, self, context=context, changed_fields=changed_fields, existing=existing, updated=resource, resource_id=resource.id)
