]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
task/ansible: reset fail_log file index 1556/head
authorKyr Shatskyy <kyrylo.shatskyy@suse.com>
Fri, 4 Sep 2020 20:53:05 +0000 (22:53 +0200)
committerKyr Shatskyy <kyrylo.shatskyy@suse.com>
Fri, 4 Sep 2020 22:07:17 +0000 (00:07 +0200)
The yaml.safe_load reads the fail_log opened file
and shifts the offset to the end of stream.
However in case of error we need to shift offset
to the begin of the file stream, so we can read
data again.

Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
teuthology/task/ansible.py

index 823bb20fc0c4f2c70e97181aae6270c8e0b35615..9103b357e2178fe1207a7c86293eedfdbdf84a94 100644 (file)
@@ -307,6 +307,7 @@ class Ansible(Task):
                         self.failure_log.name, e
                     )
                 )
+                fail_log.seek(0)
                 failures = fail_log.read().replace('\n', '')
 
         if failures: