[Fai-commit] r4681 - trunk/lib

lange at alioth.debian.org lange at alioth.debian.org
Sat Nov 10 15:26:56 UTC 2007


Author: lange
Date: 2007-11-10 15:26:56 +0000 (Sat, 10 Nov 2007)
New Revision: 4681

Modified:
   trunk/lib/subroutines
   trunk/lib/subroutines-linux
Log:
add task_error(), which stores the maximum error code in $task_error
replace $task_error= by calling new subroutine


Modified: trunk/lib/subroutines
===================================================================
--- trunk/lib/subroutines	2007-11-10 15:11:01 UTC (rev 4680)
+++ trunk/lib/subroutines	2007-11-10 15:26:56 UTC (rev 4681)
@@ -98,6 +98,17 @@
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 ### BEGIN SUBROUTINE INFO
 # Provides-Var:      $task_error
+# Required-Var:      $task_error
+# Short-Description: save the maximum error code
+### END SUBROUTINE INFO
+
+task_error() {
+
+    [ $1 -gt $task_error ] && $task_error=$1
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+### BEGIN SUBROUTINE INFO
+# Provides-Var:      $task_error
 # Required-Var:      $LOGDIR
 # Short-Description: call a certain task
 ### END SUBROUTINE INFO

Modified: trunk/lib/subroutines-linux
===================================================================
--- trunk/lib/subroutines-linux	2007-11-10 15:11:01 UTC (rev 4680)
+++ trunk/lib/subroutines-linux	2007-11-10 15:26:56 UTC (rev 4681)
@@ -190,7 +190,7 @@
 
     if [ ! -d $FAI/debconf ]; then
 	echo "Can't find debconf directory $FAI/debconf. Skipping preseeding."
-	task_error=2
+	task_error 2
 	return
     fi
     fai-debconf $FAI/debconf
@@ -246,7 +246,7 @@
 	install_packages </dev/null >> $LOGDIR/software.log 2>&1
     fi
     # This almost indicates an error
-    egrep "^E:" $LOGDIR/software.log && task_error=1
+    egrep "^E:" $LOGDIR/software.log && task_error 1
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 task_finish() {
@@ -285,7 +285,7 @@
 
     if [ -z "$SERVER" ] ; then
 	echo "SERVER not defined. Can't change network boot configuration"
-	task_error=2
+	task_error 2
 	doexit=1
     fi
     [ $doexit -eq 1 ] && return
@@ -299,7 +299,7 @@
         # first test if rsh to server works
 	$frsh true >/dev/null 2>&1
 	if [ $? -ne 0 ]; then
-	    task_error=3
+	    task_error 3
 	    echo "WARNING: $frsh failed. Can't call fai-chboot on the install server."
 	else
 	    # remove pxe config, so host will use default and boot from local disk




More information about the Fai-commit mailing list