summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGhanshyam <gmann@ghanshyammann.com>2023-03-03 03:05:40 +0000
committerGhanshyam <gmann@ghanshyammann.com>2023-03-03 03:05:40 +0000
commit21f40f3df22561a96164daedbb09032686392f22 (patch)
tree8c0b7512441ac312835afac3431781fb8af7271d
parentd52fb8cb6d2ed8893bc36f2f1f786cd890b1732e (diff)
downloadtempest-21f40f3df22561a96164daedbb09032686392f22.tar.gz
Revert "Fix DeprecationWarning of jsonschema"
This reverts commit d52fb8cb6d2ed8893bc36f2f1f786cd890b1732e. Reason for revert: We need to support till xena as Tempest master do support stable/xena onwards branches. stable/xena has jsonschema 3.2.0 only https://github.com/openstack/requirements/blob/stable/xena/upper-constraints.txt#L548 We need to avoid such bumping unless something is failing. With jsonschema 3.2.0 we do not have the new things so let's keep them and we can fix it once we have jsonschema version as upper-constraint where they are going to be removed. https://github.com/python-jsonschema/jsonschema/blob/v3.2.0/jsonschema/validators.py#L475 Change-Id: Iab8dbcd469e2ca234c9a42673b8b02f470ec2404
-rw-r--r--tempest/lib/common/jsonschema_validator.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tempest/lib/common/jsonschema_validator.py b/tempest/lib/common/jsonschema_validator.py
index 5212221c3..1618175c1 100644
--- a/tempest/lib/common/jsonschema_validator.py
+++ b/tempest/lib/common/jsonschema_validator.py
@@ -18,7 +18,7 @@ from oslo_utils import timeutils
# JSON Schema validator and format checker used for JSON Schema validation
JSONSCHEMA_VALIDATOR = jsonschema.Draft4Validator
-FORMAT_CHECKER = jsonschema.Draft4Validator.FORMAT_CHECKER
+FORMAT_CHECKER = jsonschema.draft4_format_checker
# NOTE(gmann): Add customized format checker for 'date-time' format because:
@@ -39,7 +39,7 @@ def _validate_datetime_format(instance):
return True
-@FORMAT_CHECKER.checks('base64')
+@jsonschema.FormatChecker.cls_checks('base64')
def _validate_base64_format(instance):
try:
if isinstance(instance, str):