The report path is opened for 'a' here when it should be opened for
'r'.  I also cleaned up some minor stylistic things.

Risk: Low (it didn't work before)
Visibility: Medium (now it works...though no one really noticed it
                    didn't :-)

Signed-off-by: Jeremy Orlow <jorlow@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2134 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/tests/unixbench/unixbench.py b/client/tests/unixbench/unixbench.py
index d98fd81..cf8f7b2 100755
--- a/client/tests/unixbench/unixbench.py
+++ b/client/tests/unixbench/unixbench.py
@@ -8,7 +8,8 @@
 
     def initialize(self):
         self.job.require_gcc()
-        self.keyval = open(self.resultsdir + '/keyval', 'w')
+        keyval_path = os.path.join(self.resultsdir, 'keyval')
+        self.keyval = open(keyval_path, 'w')
         self.err = None
 
 
@@ -22,7 +23,7 @@
         utils.system('make')
 
 
-    def run_once(self, args = '', stepsecs=0):
+    def run_once(self, args='', stepsecs=0):
         vars = ('TMPDIR=\"%s\" RESULTDIR=\"%s\"' %
                (self.tmpdir, self.resultsdir))
         if stepsecs:
@@ -35,8 +36,8 @@
         os.chdir(self.srcdir)
         utils.system(vars + ' ./Run ' + args)
 
-        report_path = os.path.join(self.resultsdir + '/report')
-        report = open(report_path, 'a')
+        report_path = os.path.join(self.resultsdir, 'report')
+        report = open(report_path, 'r')
         self.format_results(report, self.keyval)
 
 
@@ -84,11 +85,6 @@
                 break
 
 
-if __name__ == '__main__':
-    import sys
-    unixbench.format_results(sys.stdin, sys.stdout)
-
-
 """ Here is a sample report file:
 
   BYTE UNIX Benchmarks (Version 4.1.0)