rename binary to source in versioned notifications

In the nova notification code path the nova service / binary names
are hardcoded. There is a possible confusion as the REST API uses
'nova-osapi_compute' while the notifications use 'nova-api'
as the name of the nova compute service binary.

To make it clear that these names used in the notifications
are not the official service names the field storing it is renamed
from 'binary' to 'source'. This renaming means that the version of
NotificationPublisher ovo needed a major version bump. However this
does not effect the consumers of the notifications as the
NotificationPublisher is not directly serialized to the payload wire
format. Instead the value  of the 'source' and 'host' fields are
dumped into the publisher_id field of the notification envelope.
Therefore this patch does not introduce a backward incompatible
change from the notification consumer perspective.

A subsequent patch will change this field to an enum to furter clarify
the possible values for notifications.

Change-Id: I95b5b0826190d396efe7bfc017f6081a6356da65
Related-Bug: #1696152
This commit is contained in:
Balazs Gibizer
2017-07-25 16:46:26 +02:00
parent 427f4ec430
commit f468dae28a
8 changed files with 30 additions and 29 deletions

View File

@@ -27,16 +27,16 @@ CONF = nova.conf.CONF
def _emit_exception_notification(notifier, context, ex, function_name, args,
binary):
source):
_emit_legacy_exception_notification(notifier, context, ex, function_name,
args)
_emit_versioned_exception_notification(context, ex, binary)
_emit_versioned_exception_notification(context, ex, source)
@rpc.if_notifications_enabled
def _emit_versioned_exception_notification(context, ex, binary):
def _emit_versioned_exception_notification(context, ex, source):
versioned_exception_payload = exception.ExceptionPayload.from_exception(ex)
publisher = base.NotificationPublisher(host=CONF.host, binary=binary)
publisher = base.NotificationPublisher(host=CONF.host, source=source)
event_type = base.EventType(
object='compute',
action=fields.NotificationAction.EXCEPTION)