Added support for versioned notifications

In this changeset, I added all the required modification in order
for Watcher to enable the implementation of versioned notifications.

Change-Id: I600ecbc767583824555b016fb9fc7faf69c53b39
Partially-Implements: blueprint watcher-notifications-ovo
This commit is contained in:
Vincent Françoise
2016-10-17 17:17:56 +02:00
parent 9dc3fce3e5
commit b27e5b91b9
17 changed files with 594 additions and 31 deletions

View File

@@ -121,7 +121,7 @@ class RequestContextSerializer(messaging.Serializer):
return self._base.deserialize_entity(context, entity)
def serialize_context(self, context):
return context
return context.to_dict()
def deserialize_context(self, context):
return watcher_context.RequestContext.from_dict(context)
@@ -146,8 +146,6 @@ def get_server(target, endpoints, serializer=None):
serializer=serializer)
def get_notifier(service=None, host=None, publisher_id=None):
def get_notifier(publisher_id):
assert NOTIFIER is not None
if not publisher_id:
publisher_id = "%s.%s" % (service, host or CONF.host)
return NOTIFIER.prepare(publisher_id=publisher_id)