[livemedia-creator 2/4] livemedia-creator: Log the line that caused the failure

Brian C. Lane bcl at redhat.com
Wed Jul 2 22:17:39 UTC 2014


Sometimes it can be hard to tell exactly what triggered the error
detection, so log the line that matched.
---
 src/sbin/livemedia-creator | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/sbin/livemedia-creator b/src/sbin/livemedia-creator
index 378282f..1a18f3a 100755
--- a/src/sbin/livemedia-creator
+++ b/src/sbin/livemedia-creator
@@ -151,10 +151,12 @@ class LogRequestHandler(SocketServer.BaseRequestHandler):
         for t in simple_tests:
             if t in line:
                 self.server.log_error = True
+                self.server.error_line = line
                 return
         for t in re_tests:
             if re.search(t, line):
                 self.server.log_error = True
+                self.server.error_line = line
                 return
 
 
@@ -168,6 +170,7 @@ class LogServer(SocketServer.TCPServer):
         """
         self.kill = False
         self.log_error = False
+        self.error_line = ""
         self.log_path = log_path
         SocketServer.TCPServer.__init__(self, *args, **kwargs)
 
@@ -750,7 +753,7 @@ def virt_install(opts, install_log, disk_img, disk_size):
         iso_mount.umount()
 
     if log_monitor.server.log_check():
-        raise InstallError("virt_install failed")
+        raise InstallError("virt_install failed on line: %s" % log_monitor.server.error_line)
 
     if opts.make_fsimage:
         make_fsimage(diskimg_path, disk_img, disk_size, label=opts.fs_label)
-- 
1.9.3



More information about the anaconda-patches mailing list