[Piglit] [PATCH 1/2] json.py: use the existing filename when updating results version

Thomas Wood thomas.wood at intel.com
Thu Apr 23 08:03:02 PDT 2015


Signed-off-by: Thomas Wood <thomas.wood at intel.com>
---
 framework/backends/json.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/framework/backends/json.py b/framework/backends/json.py
index affd64e..d68dd7d 100644
--- a/framework/backends/json.py
+++ b/framework/backends/json.py
@@ -296,10 +296,9 @@ def _update_results(results, filepath):
     results = loop_updates(results)
 
     # Move the old results, and write the current results
-    filedir = os.path.dirname(filepath)
     try:
-        os.rename(filepath, os.path.join(filedir, 'results.json.old'))
-        _write(results, os.path.join(filedir, 'results.json'))
+        os.rename(filepath, filepath + '.old')
+        _write(results, filepath)
     except OSError:
         print("WARNING: Could not write updated results {}".format(filepath),
               file=sys.stderr)
-- 
2.1.0



More information about the Piglit mailing list