Merge "The field instance_name was added to InstanceCreatePayload"

This commit is contained in:
Zuul 2019-01-16 21:12:12 +00:00 committed by Gerrit Code Review
commit a80bc66dc7
4 changed files with 18 additions and 6 deletions

View File

@ -20,8 +20,9 @@
"trusted_image_certificates": [
"cert-id-1",
"cert-id-2"
]
],
"instance_name": "instance-00000001"
},
"nova_object.name":"InstanceCreatePayload",
"nova_object.version": "1.10"
"nova_object.version": "1.11"
}

View File

@ -228,13 +228,14 @@ class InstanceCreatePayload(InstanceActionPayload):
# InstanceCreatePayload
# 1.10: Added action_initiator_user and action_initiator_project to
# InstancePayload
VERSION = '1.10'
# 1.11: Added instance_name to InstanceCreatePayload
VERSION = '1.11'
fields = {
'keypairs': fields.ListOfObjectsField('KeypairPayload'),
'tags': fields.ListOfStringsField(),
'trusted_image_certificates': fields.ListOfStringsField(
nullable=True)
nullable=True),
'instance_name': fields.StringField(nullable=True),
}
def __init__(self, context, instance, fault, bdms):
@ -250,6 +251,7 @@ class InstanceCreatePayload(InstanceActionPayload):
self.trusted_image_certificates = None
if instance.trusted_certs:
self.trusted_image_certificates = instance.trusted_certs.ids
self.instance_name = instance.name
@nova_base.NovaObjectRegistry.register_notification

View File

@ -397,7 +397,7 @@ notification_object_data = {
'1.0-a73147b93b520ff0061865849d3dfa56',
'InstanceActionVolumeSwapPayload': '1.7-d3252403a9437bcdc80f1075214f8b45',
'InstanceCreateNotification': '1.0-a73147b93b520ff0061865849d3dfa56',
'InstanceCreatePayload': '1.10-291b44932569b8ff864d911814293cfc',
'InstanceCreatePayload': '1.11-7513127966bc8f270946634d099e71c0',
'InstancePayload': '1.7-78354572f699b9a6ad9996b199d03375',
'InstanceActionSnapshotNotification':
'1.0-a73147b93b520ff0061865849d3dfa56',

View File

@ -0,0 +1,9 @@
---
features:
- |
The field ``instance_name`` has been added to the
``InstanceCreatePayload`` in the following versioned notifications:
* ``instance.create.start``
* ``instance.create.end``
* ``instance.create.error``