Transform aggregate.delete notification

The aggregate.delete.start and aggregate.delete.end notifications
has been transformed to the versioned notification framework.

Implements: bp versioned-notification-transformation-ocata
Change-Id: I911e7aef813380291e6cf166eac91b53215a3726
This commit is contained in:
Balazs Gibizer 2016-11-07 17:07:41 +01:00
parent 5ba7ff63de
commit 99fffea9dc
4 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,19 @@
{
"priority": "INFO",
"payload": {
"nova_object.version": "1.0",
"nova_object.namespace": "nova",
"nova_object.name": "AggregatePayload",
"nova_object.data": {
"name": "my-aggregate",
"metadata": {
"availability_zone": "nova"
},
"hosts": [],
"id": 1,
"uuid": "788608ec-ebdc-45c5-bc7f-e5f24ab92c80"
}
},
"event_type": "aggregate.delete.end",
"publisher_id": "nova-api:fake-mini"
}

View File

@ -0,0 +1,19 @@
{
"priority": "INFO",
"payload": {
"nova_object.version": "1.0",
"nova_object.namespace": "nova",
"nova_object.name": "AggregatePayload",
"nova_object.data": {
"name": "my-aggregate",
"metadata": {
"availability_zone": "nova"
},
"hosts": [],
"id": 1,
"uuid": "788608ec-ebdc-45c5-bc7f-e5f24ab92c80"
}
},
"event_type": "aggregate.delete.start",
"publisher_id": "nova-api:fake-mini"
}

View File

@ -41,6 +41,8 @@ class AggregatePayload(base.NotificationPayloadBase):
@base.notification_sample('aggregate-create-start.json')
@base.notification_sample('aggregate-create-end.json')
@base.notification_sample('aggregate-delete-start.json')
@base.notification_sample('aggregate-delete-end.json')
@nova_base.NovaObjectRegistry.register_notification
class AggregateNotification(base.NotificationBase):
# Version 1.0: Initial version

View File

@ -38,3 +38,19 @@ class TestAggregateNotificationSample(
'uuid': self.ANY,
'id': aggregate['id']},
actual=fake_notifier.VERSIONED_NOTIFICATIONS[1])
self.admin_api.delete_aggregate(aggregate['id'])
self.assertEqual(4, len(fake_notifier.VERSIONED_NOTIFICATIONS))
self._verify_notification(
'aggregate-delete-start',
replacements={
'uuid': self.ANY,
'id': aggregate['id']},
actual=fake_notifier.VERSIONED_NOTIFICATIONS[2])
self._verify_notification(
'aggregate-delete-end',
replacements={
'uuid': self.ANY,
'id': aggregate['id']},
actual=fake_notifier.VERSIONED_NOTIFICATIONS[3])