Adding auto_disk_config field to InstancePayload

Add auto_disk_config field to InstancePayload based on
instance.auto_disk_config boolean value. If true, set it to
AUTO else MANUAL.

Implements: bp additional-notification-fields-for-searchlight
Change-Id: I18af99479562e2fe5e74e6e1252b804b074fee58
This commit is contained in:
Sujitha 2017-01-11 21:43:07 +00:00 committed by Balazs Gibizer
parent eb1ac77dd7
commit bb7d5214a4
47 changed files with 120 additions and 53 deletions

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -37,6 +37,7 @@
"power_state":"pending",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -64,7 +65,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"ERROR",
"publisher_id":"nova-compute:compute"

View File

@ -27,6 +27,7 @@
"power_state":"pending",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -54,7 +55,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -27,6 +27,7 @@
"power_state":"pending",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":"2012-10-29T13:42:11Z",
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -54,7 +55,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"shutdown",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -25,6 +25,7 @@
"device_name": "tapce531f90-19"
}
}],
"auto_disk_config":"MANUAL",
"kernel_id":"",
"launched_at":"2012-10-29T13:42:11Z",
"image_uuid": "a2459075-d96c-40d5-893e-577ff92e721c",
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -35,6 +35,7 @@
"device_name": "tapce531f90-19"
}
}],
"auto_disk_config":"MANUAL",
"kernel_id":"",
"launched_at":"2012-10-29T13:42:11Z",
"image_uuid": "a2459075-d96c-40d5-893e-577ff92e721c",
@ -77,7 +78,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"ERROR",
"publisher_id":"nova-compute:compute"

View File

@ -25,6 +25,7 @@
"device_name": "tapce531f90-19"
}
}],
"auto_disk_config":"MANUAL",
"kernel_id":"",
"launched_at":"2012-10-29T13:42:11Z",
"image_uuid": "a2459075-d96c-40d5-893e-577ff92e721c",
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -3,7 +3,7 @@
"publisher_id": "nova-compute:compute",
"payload": {
"nova_object.namespace": "nova",
"nova_object.version": "1.1",
"nova_object.version":"1.2",
"nova_object.data": {
"node": "fake-mini",
"fault": null,
@ -12,6 +12,7 @@
"image_uuid": "a2459075-d96c-40d5-893e-577ff92e721c",
"display_name": "some-server",
"display_description": "some-server",
"auto_disk_config":"MANUAL",
"tenant_id": "6f70656e737461636b20342065766572",
"kernel_id": "",
"created_at": "2012-10-29T13:42:11Z",

View File

@ -11,6 +11,7 @@
"task_state": "rebuilding",
"deleted_at": null,
"architecture": null,
"auto_disk_config":"MANUAL",
"ramdisk_id": "",
"locked": false,
"created_at": "2012-10-29T13:42:11Z",
@ -76,7 +77,7 @@
"nova_object.namespace": "nova"
}
},
"nova_object.version": "1.1",
"nova_object.version":"1.2",
"nova_object.namespace": "nova"
},
"publisher_id": "nova-compute:compute",

View File

@ -5,13 +5,14 @@
"payload": {
"nova_object.name": "InstanceActionPayload",
"nova_object.namespace": "nova",
"nova_object.version": "1.1",
"nova_object.version":"1.2",
"nova_object.data": {
"display_description": "some-server",
"reservation_id": "r-rqe0mlje",
"progress": 0,
"user_id": "fake",
"task_state": "rebuilding",
"auto_disk_config":"MANUAL",
"node": "fake-mini",
"created_at": "2012-10-29T13:42:11Z",
"kernel_id": "",
@ -71,4 +72,4 @@
"fault": null
}
}
}
}

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -40,6 +40,7 @@
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -67,7 +68,7 @@
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
"nova_object.version":"1.2"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"

View File

@ -45,6 +45,7 @@
"nova_object.version": "1.0"},
"tenant_id": "6f70656e737461636b20342065766572",
"terminated_at": null,
"auto_disk_config":"MANUAL",
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
@ -72,7 +73,7 @@
"uuid": "c03c0bf9-f46e-4e4f-93f1-817568567ee2"},
"nova_object.name": "InstanceUpdatePayload",
"nova_object.namespace": "nova",
"nova_object.version": "1.2"},
"nova_object.version": "1.3"},
"priority": "INFO",
"publisher_id": "nova-compute:fake-mini"
}

View File

@ -64,12 +64,13 @@
"task_state": null,
"tenant_id": "6f70656e737461636b20342065766572",
"terminated_at": null,
"auto_disk_config":"MANUAL",
"user_id": "fake",
"uuid": "0ab886d0-7443-4107-9265-48371bfa662b"
},
"nova_object.name": "InstanceActionVolumeSwapPayload",
"nova_object.namespace": "nova",
"nova_object.version": "1.1"
"nova_object.version": "1.2"
},
"priority": "INFO",
"publisher_id": "nova-compute:compute"

View File

@ -74,12 +74,13 @@
"task_state": null,
"tenant_id": "6f70656e737461636b20342065766572",
"terminated_at": null,
"auto_disk_config":"MANUAL",
"user_id": "fake",
"uuid": "0ab886d0-7443-4107-9265-48371bfa662b"
},
"nova_object.name": "InstanceActionVolumeSwapPayload",
"nova_object.namespace": "nova",
"nova_object.version": "1.1"
"nova_object.version": "1.2"
},
"priority": "ERROR",
"publisher_id": "nova-compute:compute"

View File

@ -64,12 +64,13 @@
"task_state": null,
"tenant_id": "6f70656e737461636b20342065766572",
"terminated_at": null,
"auto_disk_config":"MANUAL",
"user_id": "fake",
"uuid": "0ab886d0-7443-4107-9265-48371bfa662b"
},
"nova_object.name": "InstanceActionVolumeSwapPayload",
"nova_object.namespace": "nova",
"nova_object.version": "1.1"
"nova_object.version": "1.2"
},
"priority": "INFO",
"publisher_id": "nova-compute:compute"

View File

@ -49,10 +49,12 @@ class InstancePayload(base.NotificationPayloadBase):
'metadata': ('instance', 'metadata'),
'locked': ('instance', 'locked'),
'auto_disk_config': ('instance', 'auto_disk_config')
}
# Version 1.0: Initial version
# Version 1.1: add locked and display_description field
VERSION = '1.1'
# Version 1.2: Add auto_disk_config field
VERSION = '1.2'
fields = {
'uuid': fields.UUIDField(),
'user_id': fields.StringField(nullable=True),
@ -87,6 +89,7 @@ class InstancePayload(base.NotificationPayloadBase):
'metadata': fields.DictOfStringsField(),
'locked': fields.BooleanField(),
'auto_disk_config': fields.DiskConfigField()
}
def __init__(self, instance, **kwargs):
@ -113,7 +116,8 @@ class InstanceActionPayload(InstancePayload):
# No SCHEMA as all the additional fields are calculated
# Version 1.1: locked and display_description added to InstancePayload
VERSION = '1.1'
# Version 1.2: Added auto_disk_config field to InstancePayload
VERSION = '1.2'
fields = {
'fault': fields.ObjectField('ExceptionPayload', nullable=True),
}
@ -130,7 +134,8 @@ class InstanceActionVolumeSwapPayload(InstanceActionPayload):
# No SCHEMA as all the additional fields are calculated
# Version 1.1: locked and display_description added to InstancePayload
VERSION = '1.1'
# Version 1.2: Added auto_disk_config field to InstancePayload
VERSION = '1.2'
fields = {
'old_volume_id': fields.UUIDField(),
'new_volume_id': fields.UUIDField(),
@ -149,7 +154,8 @@ class InstanceUpdatePayload(InstancePayload):
# Version 1.0: Initial version
# Version 1.1: locked and display_description added to InstancePayload
# Version 1.2: Added tags field
VERSION = '1.2'
# Version 1.3: Added auto_disk_config field to InstancePayload
VERSION = '1.3'
fields = {
'state_update': fields.ObjectField('InstanceStateUpdatePayload'),
'audit_period': fields.ObjectField('AuditPeriodPayload'),

View File

@ -333,6 +333,18 @@ class DiskBus(BaseNovaEnum):
ALL = (FDC, IDE, SATA, SCSI, USB, VIRTIO, XEN, LXC, UML)
class DiskConfig(BaseNovaEnum):
MANUAL = "MANUAL"
AUTO = "AUTO"
ALL = (MANUAL, AUTO)
def coerce(self, obj, attr, value):
enum_value = DiskConfig.AUTO if value else DiskConfig.MANUAL
return super(DiskConfig, self).coerce(obj, attr, enum_value)
class FirmwareType(BaseNovaEnum):
UEFI = "uefi"
@ -1074,6 +1086,10 @@ class DiskBusField(BaseEnumField):
AUTO_TYPE = DiskBus()
class DiskConfigField(BaseEnumField):
AUTO_TYPE = DiskConfig()
class FirmwareTypeField(BaseEnumField):
AUTO_TYPE = FirmwareType()

View File

@ -513,7 +513,8 @@ class UsageInfoTestCase(test.TestCase):
self.assertEqual(str(flavor['flavorid']), flavorid)
for attr in ('display_name', 'created_at', 'launched_at',
'state', 'task_state', 'display_description', 'locked'):
'state', 'task_state', 'display_description', 'locked',
'auto_disk_config'):
self.assertIn(attr, payload, "Key %s not in payload" % attr)
self.assertEqual(payload['image_uuid'], uuids.fake_image_ref)

View File

@ -357,14 +357,14 @@ notification_object_data = {
'FlavorNotification': '1.0-a73147b93b520ff0061865849d3dfa56',
'FlavorPayload': '1.3-6335e626893d7df5f96f87e6731fef56',
'InstanceActionNotification': '1.0-a73147b93b520ff0061865849d3dfa56',
'InstanceActionPayload': '1.1-8d12efc3251c606b61b3d479a9da51be',
'InstanceActionPayload': '1.2-b7b2481bcd0e1edcc1970ef7150df5aa',
'InstanceActionVolumeSwapNotification':
'1.0-a73147b93b520ff0061865849d3dfa56',
'InstanceActionVolumeSwapPayload': '1.1-fbb6618f652a7f88742495ea3185582c',
'InstancePayload': '1.1-5b9e3a4bb805d9fed20063bc237e4913',
'InstanceActionVolumeSwapPayload': '1.2-d7925b763e0795f8e5c1aa0e95bd67bd',
'InstancePayload': '1.2-a1988f6fe728bd4b478353a85c48ad55',
'InstanceStateUpdatePayload': '1.0-07e111c0fa0f6db0f79b0726d593e3da',
'InstanceUpdateNotification': '1.0-a73147b93b520ff0061865849d3dfa56',
'InstanceUpdatePayload': '1.2-67174f00c1ed9b5a6c408a31bd2540a5',
'InstanceUpdatePayload': '1.3-5bf5f18ed1232b1d8884fa784b77728f',
'IpPayload': '1.0-8ecf567a99e516d4af094439a7632d34',
'NotificationPublisher': '1.0-bbbc1402fb0e443a3eb227cc52b61545',
'ServiceStatusNotification': '1.0-a73147b93b520ff0061865849d3dfa56',
@ -447,6 +447,7 @@ class TestInstanceNotification(test.NoDBTestCase):
metadata={},
uuid=uuids.instance1,
locked=False,
auto_disk_config=False,
**instance_values)
self.payload = {
'bandwidth': {},