Fix compatibility with jsonschema>=4.0.0
Specify the schema version for network_data and node, otherwise the
latest one is used.
Also fix one test where the error messages was changed.
Change-Id: I4a614d7e73348bbe6c355a40881b013cbfe00b03
(cherry picked from commit 55b9579f14
)
This commit is contained in:
parent
b32267b0dc
commit
224db335b4
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://openstack.org/nova/network_data.json#",
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"id": "http://openstack.org/nova/network_data.json",
|
||||
"type": "object",
|
||||
"title": "OpenStack Nova network metadata schema",
|
||||
|
|
|
@ -140,6 +140,7 @@ def network_data_schema():
|
|||
def node_schema():
|
||||
network_data = network_data_schema()
|
||||
return {
|
||||
'$schema': 'http://json-schema.org/draft-07/schema#',
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'automated_clean': {'type': ['string', 'boolean', 'null']},
|
||||
|
|
|
@ -883,7 +883,7 @@ class TestPost(BaseDeployTemplatesAPITest):
|
|||
def test_create_invalid_step_field_priority(self):
|
||||
self._test_create_invalid_step_field(
|
||||
'priority', 'not a number',
|
||||
"'not a number' is not of type 'integer'")
|
||||
"'not a number'") # differs between jsonschema versions
|
||||
|
||||
def test_create_invalid_step_field_negative_priority(self):
|
||||
self._test_create_invalid_step_field(
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
fixes:
|
||||
- |
|
||||
Fixes compatibility with ``jsonschema`` package version 4.0.0 or newer
|
||||
by providing a proper schema version (Draft-07 currently).
|
||||
issues:
|
||||
- |
|
||||
When using ``jsonschema`` 4.0.0 or newer, make sure to include a proper
|
||||
``$schema`` field in your custom network data or RAID schemas.
|
Loading…
Reference in New Issue