[Ocfs2-test-devel] [PATCH 1/1] Ocfs2-test: Return error code and print error log once mpi_run failed.

Tristan Ye tristan.ye at oracle.com
Mon Jan 5 17:48:47 PST 2009


Once mpi_run by os.waitpid() failed after a os.error exception captured, we'd
better print its corresponding error msg and return error code to caller to decide
if the tests succeed or not.

Signed-off-by: Tristan Ye <tristan.ye at oracle.com>
---
 programs/python_common/o2tf.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/programs/python_common/o2tf.py b/programs/python_common/o2tf.py
index 53d7865..434d3c4 100644
--- a/programs/python_common/o2tf.py
+++ b/programs/python_common/o2tf.py
@@ -234,7 +234,7 @@ so just do a sanity check here to test if all nodes are available.
 
 	except os.error,inst:
 		printlog(str(inst), logfile, 0, '')
-		pass
+		return -1
 #
 # StartMPI is used by :
 #   - o2tf.py
@@ -343,8 +343,9 @@ def openmpi_run(DEBUGON, nproc, cmd, nodes, remote_sh, logfile, w_flag):
 		else:
 			os.waitpid(pid, 0)
 
-	except os.error:
-		pass
+	except os.error,inst:
+		printlog(str(inst), logfile, 0, '')
+		return -1
 
 #
 # lamexec is used by :
-- 
1.5.5




More information about the Ocfs2-test-devel mailing list