Merge "Fix bug 2114951"

This commit is contained in:
Zuul
2025-09-10 14:38:54 +00:00
committed by Gerrit Code Review
2 changed files with 4 additions and 4 deletions

View File

@@ -27,11 +27,11 @@ _legacy_block_device_mapping = {
'volume_id': parameter_types.volume_id,
'snapshot_id': parameter_types.image_id,
'volume_size': parameter_types.volume_size,
# Do not allow empty device names and number values and
# containing spaces(defined in nova/block_device.py:from_api())
# Do not allow empty device names or spaces in name (defined in
# nova/block_device.py:validate_device_name())
'device_name': {
'type': 'string', 'minLength': 1, 'maxLength': 255,
'pattern': '^[a-zA-Z0-9._-r/]*$',
'pattern': '^[a-zA-Z0-9._/-]*$',
},
# Defined as boolean in nova/block_device.py:from_api()
'delete_on_termination': parameter_types.boolean,

View File

@@ -146,7 +146,7 @@ class BootFromVolumeTest(test.TestCase):
req.body = jsonutils.dump_as_bytes(body)
req.headers['content-type'] = 'application/json'
res = req.get_response(fakes.wsgi_app_v21())
self.assertEqual(400, res.status_int)
self.assertEqual(202, res.status_int)
class VolumeApiTestV21(test.NoDBTestCase):