[PATCH 1/3] Strip off the timestamp from error output pulled from program.log.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 storage/devicelibs/lvm.py    |    4 +++-
 storage/devicelibs/mdraid.py |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/storage/devicelibs/lvm.py b/storage/devicelibs/lvm.py
index fb9482b..a0b01e7 100644
--- a/storage/devicelibs/lvm.py
+++ b/storage/devicelibs/lvm.py
@@ -167,7 +167,9 @@ def lvm(args, progress=None):
         return
 
     try:
-        msg = open("/tmp/program.log").readlines()[-1].strip()
+        # grab the last line of program.log and strip off the timestamp
+        msg = open("/tmp/program.log").readlines()[-1]
+        msg = msg.split(" : ", 1)[1].strip()
     except Exception:
         msg = ""
 
diff --git a/storage/devicelibs/mdraid.py b/storage/devicelibs/mdraid.py
index 589fb36..5cf8cb4 100644
--- a/storage/devicelibs/mdraid.py
+++ b/storage/devicelibs/mdraid.py
@@ -133,7 +133,9 @@ def mdadm(args, progress=None):
         return
 
     try:
-        msg = open("/tmp/program.log").readlines()[-1].strip()
+        # grab the last line of program.log and strip off the timestamp
+        msg = open("/tmp/program.log").readlines()[-1]
+        msg = msg.split(" : ", 1)[1].strip()
     except Exception:
         msg = ""
 
-- 
1.6.2.5

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux