[PATCH 2/2] livemedia-creator: Skip errors inside a logged exception block

Brian C. Lane bcl at redhat.com
Fri Apr 25 18:10:43 UTC 2014


blivet is now logging some tracebacks and continuing, lmc will now
ignore any errors inside these exception blocks when monitoring the
virt-install log for failures.
---
 src/sbin/livemedia-creator | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/src/sbin/livemedia-creator b/src/sbin/livemedia-creator
index 75198f0..b3efed1 100755
--- a/src/sbin/livemedia-creator
+++ b/src/sbin/livemedia-creator
@@ -83,6 +83,7 @@ class LogRequestHandler(SocketServer.BaseRequestHandler):
         else:
             print "no log_path specified"
         self.request.settimeout(10)
+        self.tb_continue = False
 
     def handle(self):
         """
@@ -124,12 +125,31 @@ class LogRequestHandler(SocketServer.BaseRequestHandler):
     def iserror(self, line):
         """
         Check a line to see if it contains an error indicating install failure
+
+        This is complicated by blivet logging the traceback from some errors and
+        continuing on. They are wrapped in:
+        "Caught exception, continuing." ... "End exception details."
+
+        Errors inside the block are ignored.
         """
         simple_tests = ["Traceback (",
                         "Out of memory:",
                         "Call Trace:",
                         "insufficient disk space:"]
         re_tests =     [r"WARNING packaging: base repo .* not valid"]
+        tb_ok_start = "Caught exception, continuing."
+        tb_ok_end = "End exception details."
+
+        if not self.tb_continue:
+            if tb_ok_start in line:
+                self.tb_continue = True
+                return
+        else:
+            # Ignore errors until the end of the exception log
+            if tb_ok_end in line:
+                self.tb_continue = False
+            return
+
         for t in simple_tests:
             if t in line:
                 self.server.log_error = True
-- 
1.9.0



More information about the anaconda-patches mailing list