7 Commits

Author SHA1 Message Date
Béla Vancsics
9413fc0f1f Transform aggregate.update_metadata notification
The aggregate.update_metadata.start and aggregate.update_metadata.end
notifications has been transformed to the versioned notification framework.

Co-Authored-By: Takashi Natsume <natsume.takashi@lab.ntt.co.jp>
Change-Id: Iab73b1351a50869620334f692aaefb566ba4ddf8
Implements: bp versioned-notification-transformation-rocky
2018-04-04 23:25:42 +00:00
Balazs Gibizer
249c96751c Transform aggregate.remove_host notification
The aggregate.remove_host.start and aggregate.remove_host.end notifications
has been transformed to the versioned notification framework.

Note that the legacy event_type was aggregate.removehost but the versioned
notification is named to aggregate.remove_host to keep the naming consistent
with the other event_types.

Implements: bp versioned-notification-transformation-queens
Change-Id: I5cb84eb797ca98964a04b5b495fba263db98a54f
2017-09-08 16:24:10 +02:00
Balazs Gibizer
3f80209a51 Transform aggregate.add_host notification
The aggregate.add_host.start and aggregate.add_host.end notifications
has been transformed to the versioned notification framework.

Note that the legacy event_type was aggregate.addhost but the versioned
notification is named to aggregate.add_host to keep the naming consistent
with the other event_types.

Implements: bp versioned-notification-transformation-queens
Change-Id: I980d89f47b944116e5fc9cedd74c43bbd88fbeae
2017-09-08 14:14:00 +02:00
Balazs Gibizer
6de0d2d1a0 Remove **kwargs passing in payload __init__
The **kwargs was used in the payload class ctor to pass the payload
fields initialization up to the ovo base class. This is unnecessary
and confusing.

This patch replaces the **kwargs passing with direct field initialization
to make the payload construction more explicit.

Change-Id: I7770f6550fa40c1d9b0417efa57f58fa9c998d45
Implements: bp versioned-notification-transformation-pike
Co-Authored-By: Stephen Finucane <sfinucan@redhat.com>
2017-06-08 08:50:40 +00:00
Balazs Gibizer
d8bad7377b handle uninited fields in notification payload
Due to the not strict handling of uninitialized fields during
notification payload population it is possible that the emitted
notification missing some of the fields defined in the schema.

There are two problematic cases:
1) no load tirggered for lazy loaded fields. If the field was not
   loaded it is not added to the payload.
2) uninitialized, not lazy loadable fields are not added to the
   payload.

This patch makes sure that lazy load is triggered. If the field is
not lazy loadable and also not initialized then related payload
field will be set to None. If the payload field is not nullable
the code will fail to make sure that the inconsistency is detected.

The following changes cannot be split to different commits because
as soon as the generic schema population code is fixed every listed
notification starts behaving differently.

In some cases the availability_zone field of the Service object is left
unitialized by both the constructor and the obj_load_attr function this
caused that the availability_zone field of the service.update
notification was missing from the emitted notification payload.

The extra_specs field of the Flavor object is not lazy loadable and not
initialized in the Flavor destroy case. So the extra_specs field of the
FlavorPayload needed to be made nullable.

The projects field of the Flavor object is lazy loaded but when the
Flavor object is loaded as part of an Instance object Flavor is
orphaned and no lazy load is allowed on that Flavor object. In this
case the projects field of the FlavorPayload will be set to None to
signal that the information is not available. This also means that
the projects field of the FlavorPayload needed to be changed to
nullable.

The hosts and id fields of the Aggregate object is not initialized
during the create of the Aggregate before the aggregate.create.start
needs to be sent. Therefore these fields needs to be nullable.

Closes-Bug: #1653221
Change-Id: Ib122cd98ee0cc31938d5ff1d5c753053267a3bd4
2017-03-03 15:34:41 +01:00
Balazs Gibizer
99fffea9dc 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
2017-01-04 17:45:12 +00:00
Balazs Gibizer
5ba7ff63de Transform aggregate.create notification
The aggregate.create.start and aggregate.create.end notifications
has been transformed to the versioned notification framework.

The notification payload contains the 'id' of the aggregate which
is the db primary key. It is added because the REST API also
uses the db id instead of the uuid in the os-aggregates' requests
and responses.

Implements: bp versioned-notification-transformation-ocata
Change-Id: I92fe504a8f7dc19b0e1df5884045d4bc0d9e4f98
2017-01-04 17:44:30 +00:00