From 4defca4cc19ad5ac19fc8a59a5cd9c0f4ec22bd4 Mon Sep 17 00:00:00 2001 From: Ivo De Decker Date: Sat, 14 Sep 2019 10:51:41 +0000 Subject: [PATCH] Abort when do_all fails without transaction to rollback When do_all fails, and there is no transaction to rollback, we will probably leave a broken state behind. This codepath probably isn't triggered unless something else is broken. Signed-off-by: Ivo De Decker --- britney.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/britney.py b/britney.py index be42422..c1c5f8f 100755 --- a/britney.py +++ b/britney.py @@ -1098,7 +1098,10 @@ class Britney(object): else: output_logger.info("FAILED\n") if not transaction: - return + # if we 'FAILED', but we cannot rollback, we will probably + # leave a broken state behind + # this should not happen + raise AssertionError("do_all FAILED but no transaction to rollback") transaction.rollback() if self.options.check_consistency_level >= 2: target_suite.check_suite_source_pkg_consistency('do_all after rollback')