burnin: fix removal errors hiding real errors
authorIustin Pop <iustin@google.com>
Sun, 19 Jul 2009 18:34:08 +0000 (20:34 +0200)
committerIustin Pop <iustin@google.com>
Sun, 19 Jul 2009 21:47:01 +0000 (23:47 +0200)
A long-standing bug in burnin makes errors during the removal phase
(e.g. because an import has failed, or because the initial creation has
failed) hide the original error.

This patch suppresses removal errors if we are already in ‘has_err’
mode, and otherwise it displays them normally.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

tools/burnin

index d0ef877..1ba5f7b 100755 (executable)
@@ -784,7 +784,14 @@ class Burner(object):
         Log(self.GetFeedbackBuf())
         Log("\n\n")
       if not self.opts.keep_instances:
-        self.BurnRemove()
+        try:
+          self.BurnRemove()
+        except Exception, err:
+          if has_err: # already detected errors, so errors in removal
+                      # are quite expected
+            Log("Note: error detected during instance remove: %s" % str(err))
+          else: # non-expected error
+            raise
 
     return 0