Implemented audit.create notification
In this changeset, I implemented the audit.create notification. Change-Id: Ia092ca3a3dc951e3313a07f15a98aec5818e9ab0 Partially-Implements: blueprint audit-versioned-notifications-api
This commit is contained in:
@@ -236,6 +236,11 @@ class Audit(base.WatcherPersistentObject, base.WatcherObject,
|
||||
# notifications containing information about the related relationships
|
||||
self._from_db_object(self, db_audit, eager=True)
|
||||
|
||||
def _notify():
|
||||
notifications.audit.send_create(self._context, self)
|
||||
|
||||
_notify()
|
||||
|
||||
@base.remotable
|
||||
def destroy(self):
|
||||
"""Delete the Audit from the DB."""
|
||||
|
||||
@@ -155,7 +155,7 @@ class WatcherPersistentObject(object):
|
||||
if obj[rel_id]
|
||||
)
|
||||
for obj_field, related_obj_cls, rel_id in loadable_fields:
|
||||
if db_object.get(obj_field) and obj[rel_id]:
|
||||
if getattr(db_object, obj_field, None) and obj[rel_id]:
|
||||
# The object field data was eagerly loaded alongside
|
||||
# the main object data
|
||||
obj[obj_field] = related_obj_cls._from_db_object(
|
||||
|
||||
Reference in New Issue
Block a user