Merge "Fix nits from trusted certs notification change"

This commit is contained in:
Zuul 2018-06-15 16:58:45 +00:00 committed by Gerrit Code Review
commit 93f2ca64e0
2 changed files with 12 additions and 12 deletions

View File

@ -236,7 +236,7 @@ class InstanceCreatePayload(InstanceActionPayload):
self.tags = [instance_tag.tag self.tags = [instance_tag.tag
for instance_tag in instance.tags] for instance_tag in instance.tags]
self.trusted_image_certificates = None self.trusted_image_certificates = None
if instance.get("trusted_certs", None): if instance.trusted_certs:
self.trusted_image_certificates = instance.trusted_certs.ids self.trusted_image_certificates = instance.trusted_certs.ids
@ -322,14 +322,14 @@ class InstanceActionRebuildPayload(InstanceActionPayload):
nullable=True) nullable=True)
} }
def __init__(self, context, instance, fault, bdms): def __init__(self, context, instance, fault, bdms=None):
super(InstanceActionRebuildPayload, self).__init__( super(InstanceActionRebuildPayload, self).__init__(
context=context, context=context,
instance=instance, instance=instance,
fault=fault, fault=fault,
bdms=bdms) bdms=bdms)
self.trusted_image_certificates = None self.trusted_image_certificates = None
if instance.get("trusted_certs", None): if instance.trusted_certs:
self.trusted_image_certificates = instance.trusted_certs.ids self.trusted_image_certificates = instance.trusted_certs.ids

View File

@ -30,17 +30,17 @@ features:
* ``POST /servers/{server_id}/action (rebuild)`` * ``POST /servers/{server_id}/action (rebuild)``
The payload of the ``instance.create.start`` and ``instance.create.end`` The payload of the ``instance.create.start`` and ``instance.create.end``
and ``instance.create.error`` notifications have been extended with the and ``instance.create.error`` versioned notifications have been extended
``trusted_image_certificates`` field that contains the list of trusted with the ``trusted_image_certificates`` field that contains the list of
certificate IDs used when the instance is created. trusted certificate IDs used when the instance is created.
The payload of the ``instance.rebuild.start`` and ``instance.rebuild.end`` The payload of the ``instance.rebuild.start`` and ``instance.rebuild.end``
and ``instance.rebuild.error`` notifications have been extended with the and ``instance.rebuild.error`` versioned notifications have been extended
``trusted_image_certificates`` field that contains the list of trusted with the ``trusted_image_certificates`` field that contains the list of
certificate IDs used when the instance is rebuilt. This change also causes trusted certificate IDs used when the instance is rebuilt. This change also
the type of the payload object to change from ``InstanceActionPayload`` causes the type of the payload object to change from
version 1.6 to ``InstanceActionRebuildPayload`` version 1.7. See the ``InstanceActionPayload`` version 1.6 to ``InstanceActionRebuildPayload``
`notification dev reference`_ for the sample file of version 1.7. See the `notification dev reference`_ for the sample file of
``instance.rebuild.start`` as an example. ``instance.rebuild.start`` as an example.
.. _notification dev reference: https://docs.openstack.org/developer/nova/notifications.html .. _notification dev reference: https://docs.openstack.org/developer/nova/notifications.html