Fix up error handling of aborts. Make sure we print tracebacks for
unknown exceptions.

Signed-off-by: Martin J. Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@864 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/bin/job.py b/client/bin/job.py
index 05c19c5..d465637 100755
--- a/client/bin/job.py
+++ b/client/bin/job.py
@@ -10,6 +10,7 @@
 # autotest stuff
 from autotest_utils import *
 from parallel import *
+from error import *
 import kernel, xen, test, profilers, barrier, filesystem, fd_stack, boottool
 import harness, config
 
@@ -489,6 +490,8 @@
 		if not re.match(r'(START|(END )?(GOOD|WARN|FAIL|ABORT))$', \
 								status_code):
 			raise "Invalid status code supplied: %s" % status_code
+		if not operation:
+			operation = '----'
 		if re.match(r'[\n\t]', operation):
 			raise "Invalid character in operation string"
 		operation = operation.rstrip()
@@ -548,18 +551,18 @@
 
 	except JobError, instance:
 		print "JOB ERROR: " + instance.args[0]
-		if myjob != None:
-			myjob.record('ABORT', None, instance.args[0])
+		if myjob:
+			myjob.record('ABORT', None, None, instance.args[0])
 			myjob.complete(1)
+		
 
 	except:
+		print "JOB ERROR: " + format_error()
 		if myjob:
-			myjob.harness.run_abort()
-		# Ensure we cannot continue this job, it is in rictus.
-		if os.path.exists(state):
-			os.unlink(state)
-		raise
+			myjob.record('ABORT', None, None, format_error())
+			myjob.complete(1)
 
 	# If we get here, then we assume the job is complete and good.
+	myjob.record('GOOD', None, None, 'job completed sucessfully')
 	myjob.complete(0)