If we fail to parse a failure log, fail silently and log the exception
so that we can inspect that log after the fact.
In this case a CommandFailedError will be raised.
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
def _handle_failure(self, command, status):
failures = None
with open(self.failure_log.name, 'r') as log:
- failures = yaml.safe_load(log)
+ try:
+ failures = yaml.safe_load(log)
+ except yaml.parser.ParserError:
+ log.exception("Failed to load failure log...")
if failures:
if self.ctx.archive: