Get rid of jsonschema.compat usage

jsonschema.compat module is not a public interface anymore and
it got removed in version > 3.2.0
The compat module was a helper for py2/3 compatibility [1].
As Tempest is full py3 now, we can rework the whole
if-condition and let the timeutils to handle any wrong format.

[1] https://github.com/Julian/jsonschema/blob/v3.2.0/jsonschema/compat.py

Closes-Bug: #1946321
Change-Id: Ia78c19c06cfb712b1b8d0aff457fd2f91144dc07
changes/04/812804/4
Martin Kopec 1 year ago
parent a7bcabc897
commit a47c8afc0e
  1. 2
      tempest/lib/common/jsonschema_validator.py

@ -31,7 +31,7 @@ FORMAT_CHECKER = jsonschema.draft4_format_checker
@FORMAT_CHECKER.checks('iso8601-date-time')
def _validate_datetime_format(instance):
try:
if isinstance(instance, jsonschema.compat.str_types):
if instance is not None:
timeutils.parse_isotime(instance)
except ValueError:
return False

Loading…
Cancel
Save