Update volume create schema to allow 'null'

When creating a volume from a source snapshot, size is not a required
parameter since it will be defaulted to the snapshot's original size. We
set it as not required in 8152f6c0cc, but
missed that the jsonschema validation also needed to be updated to allow
for the empty value.

Change-Id: I27b94c5579d5215fdd0fbd6c421aa5f6d9139bd8
Closes-bug: #1784821
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis 2018-08-01 08:25:38 -05:00
parent 5e5627e9ea
commit b69e041dd6
No known key found for this signature in database
GPG Key ID: CE7EE4BFAF8D70C8
2 changed files with 3 additions and 1 deletions

View File

@ -47,7 +47,7 @@ create = {
'snapshot_id': parameter_types.optional_uuid,
'source_volid': parameter_types.optional_uuid,
'consistencygroup_id': parameter_types.optional_uuid,
'size': parameter_types.volume_size,
'size': parameter_types.volume_size_allows_null,
'availability_zone': parameter_types.availability_zone,
'multiattach': parameter_types.optional_boolean,
'image_id': {'type': ['string', 'null'], 'minLength': 0,

View File

@ -211,6 +211,8 @@ volume_size = {
'minimum': 1,
'maximum': constants.DB_MAX_INT
}
volume_size_allows_null = copy.deepcopy(volume_size)
volume_size_allows_null['type'] += ['null']
hostname = {