volume_type_access: don't validate project_id as a uuid

Some legacy clouds (e.g. mine) still have some projects with
legacy project ids that don't conform to the uuid requirement.
This is an extremely obscure edge case, but this API is the only
one I've seen in all of OpenStack that rejects malformed
project ids.

Changing to a more lenient check fixes my immediate
problem and also establishes greater consistency with other APIs.

Change-Id: I27e697e7e6818b120f745641cbc8d7daed2bd7b0
This commit is contained in:
Andrew Bogott 2022-11-15 14:44:38 -06:00
parent f47d7e0bd5
commit 17a3c67aee
1 changed files with 4 additions and 4 deletions

View File

@ -18,8 +18,6 @@ Schema for V3 volume type access API.
"""
from cinder.api.validation import parameter_types
add_project_access = {
'type': 'object',
'properties': {
@ -27,7 +25,8 @@ add_project_access = {
'addProjectAccess': {
'type': 'object',
'properties': {
'project': parameter_types.uuid,
'project': {'type': 'string',
'minLength': 1, 'maxLength': 255},
},
'required': ['project'],
'additionalProperties': False,
@ -45,7 +44,8 @@ remove_project_access = {
'removeProjectAccess': {
'type': 'object',
'properties': {
'project': parameter_types.uuid,
'project': {'type': 'string',
'minLength': 1, 'maxLength': 255},
},
'required': ['project'],
'additionalProperties': False,