From 24fbf6eea0254fb04d4728fd5a0cb4eb68da2769 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Fri, 26 Dec 2014 06:23:36 -0500 Subject: [PATCH] defect 4496: Add feature to support the error message monitoring from installer pre script --- xCAT-server/share/xcat/install/scripts/pre.rh | 8 ++++++-- xCAT-server/share/xcat/install/scripts/pre.rh.rhel7 | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/pre.rh b/xCAT-server/share/xcat/install/scripts/pre.rh index c5be7d407..b37399340 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rh +++ b/xCAT-server/share/xcat/install/scripts/pre.rh @@ -87,6 +87,10 @@ try: percent = 0 count = 0 numpack = 0 + pre = 0 + if(os.path.isfile('/tmp/xcatpre.log')): + ilog = '/tmp/xcatpre.log' + pre = 1 if(os.path.isfile('/tmp/packaging.log')): ilog = '/tmp/packaging.log' if(os.path.isfile('/mnt/sysimage/root/install.log')): @@ -101,7 +105,7 @@ try: firstline = linecache.getline(ilog,1) line = linecache.getline(ilog,count) linecache.clearcache() - if(line and not post): + if(line and not post and not pre): r1 = re.compile("^Installing (\d+) ") m1 = r1.search(firstline) if m1: @@ -128,7 +132,7 @@ try: else: newline = "prep" line = "installing " + newline - if(line and post): + if(line and post and not pre): line = "installing " + line if(not line): line = "installing prep" diff --git a/xCAT-server/share/xcat/install/scripts/pre.rh.rhel7 b/xCAT-server/share/xcat/install/scripts/pre.rh.rhel7 index 54d98a9dc..f4c713aec 100755 --- a/xCAT-server/share/xcat/install/scripts/pre.rh.rhel7 +++ b/xCAT-server/share/xcat/install/scripts/pre.rh.rhel7 @@ -75,6 +75,10 @@ try: percent = 0 count = 0 numpack = 0 + pre = 0 + if(os.path.isfile('/tmp/xcatpre.log')): + ilog = '/tmp/xcatpre.log' + pre = 1 if(os.path.isfile('/tmp/packaging.log')): ilog = '/tmp/packaging.log' if(os.path.isfile('/mnt/sysimage/tmp/post.log')): @@ -84,7 +88,7 @@ try: count = len(open(ilog).readlines()) line = linecache.getline(ilog,count) linecache.clearcache() - if(line and not post): + if(line and not post and not pre): r2 = re.compile("Installing ([^ ]*) \((\d+)/(\d+)\)") m2 = r2.search(line) if m2: @@ -92,7 +96,7 @@ try: else: newline = "post" line = "installing " + newline - if(line and post): + if(line and post and not pre): line = "installing " + line if(not line): line = "installing prep"