]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
ansible: raise an AnsibleFailedError even when parsing fails 600/head
authorAndrew Schoen <aschoen@redhat.com>
Wed, 19 Aug 2015 16:06:22 +0000 (11:06 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Wed, 19 Aug 2015 16:06:22 +0000 (11:06 -0500)
If _handle_failures fails to parse the yaml in the ansible error log, it
can still give the contents of the failure log to an AnsibleFailedError
in it's unparsed form.

I also changed the log.exception to log.error when an ParserError occurs
as I think it was confusing some having that extra traceback in the log.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
teuthology/task/ansible.py

index 7f6efaa9d2ec791ace423e7e913bab3dee377592..f95a7fef52d2d134f4fc83f08fd3c0baa26085ce 100644 (file)
@@ -267,14 +267,12 @@ class Ansible(Task):
             try:
                 failures = yaml.safe_load(fail_log)
             except yaml.parser.ParserError:
-                log.exception(
+                log.error(
                     "Failed to parse ansible failure log: {0}".format(
                         self.failure_log.name,
                     )
                 )
-                # archive the log anyway so we can see what tripped up
-                # the yaml parsing
-                self._archive_failures()
+                failures = fail_log
 
         if failures:
             self._archive_failures()