]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Ansible._handle_failure: YAMLErrors are special
authorZack Cerza <zack@redhat.com>
Fri, 14 Jul 2023 17:38:54 +0000 (11:38 -0600)
committerZack Cerza <zack@redhat.com>
Fri, 14 Jul 2023 18:04:17 +0000 (12:04 -0600)
Return to treating them differently, but also continue to catch other
exceptions here.

Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/task/ansible.py

index 1ff833135bdfd842675533851f79f2b3e4abd011..aa605d2aab63f82fba07c523c881b9e726624c0d 100644 (file)
@@ -376,12 +376,12 @@ class Ansible(Task):
             try:
                 analyzer = FailureAnalyzer()
                 failures = analyzer.analyze(fail_log)
-            except Exception as e:
+            except yaml.YAMLError as e:
                 log.error(
-                    "Failed to parse ansible failure log: {0} ({1})".format(
-                        self.failure_log.name, e
-                    )
+                    f"Failed to parse ansible failure log: {self.failure_log.name} ({e})"
                 )
+            except Exception:
+                log.exception(f"Failed to analyze ansible failure log: {self.failure_log.name}")
             # If we hit an exception, or if analyze() returned nothing, use the log as-is
             if not failures:
                 failures = fail_log.replace('\n', '')