From 8581d1c5296465bb074a307837f34edf586ee3e7 Mon Sep 17 00:00:00 2001 From: Josef Skladanka Date: Jul 15 2015 08:07:33 +0000 Subject: Correctly check Testcase related exception in resultsdb_directive The error mentioned in T519 is fixed by this simple change. Although the entire `ensure_testcase_exists()` method can (and IMHO should) be removed once D431 lands. Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D432 --- diff --git a/libtaskotron/directives/resultsdb_directive.py b/libtaskotron/directives/resultsdb_directive.py index 19c18c5..299ad4d 100644 --- a/libtaskotron/directives/resultsdb_directive.py +++ b/libtaskotron/directives/resultsdb_directive.py @@ -120,7 +120,7 @@ class ResultsdbDirective(BaseDirective): self._ensured_testcases.append(name) return except resultsdb_api.ResultsDBapiException, e: - if e.message != 'Testcase not found': + if e.message.startswith('Testcase not found'): raise e # since the testcase doesn't exist, create it with a dummy value for url