commit | a47c8afc0eb3b14a7482b884fc75dd701712bc1b | [log] [tgz] |
---|---|---|
author | Martin Kopec <mkopec@redhat.com> | Thu Oct 07 09:15:55 2021 +0200 |
committer | Martin Kopec <mkopec@redhat.com> | Thu Oct 07 19:01:21 2021 +0000 |
tree | cc090c7f0280254767abf95fa71dff7d64313486 | |
parent | a7bcabc8976e6e646d5e4379e3289b43586261c1 [diff] |
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
diff --git a/tempest/lib/common/jsonschema_validator.py b/tempest/lib/common/jsonschema_validator.py index 0ac757d..1618175 100644 --- a/tempest/lib/common/jsonschema_validator.py +++ b/tempest/lib/common/jsonschema_validator.py
@@ -31,7 +31,7 @@ @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