Set permissions file of generated metrics csv file
Update tools/ct_metrics/gen_csv_results.py by setting
the permssions of the generated csv file to 666.
Resolves openbmc/openbmc-test-automation#1691
Signed-off-by: Steven Sombar <ssombar@us.ibm.com>
Change-Id: I49ead685bd36d9b873c865a63b7df29a62fb9e80
diff --git a/tools/ct_metrics/gen_csv_results.py b/tools/ct_metrics/gen_csv_results.py
index 8c10b2d..a2dbc77 100755
--- a/tools/ct_metrics/gen_csv_results.py
+++ b/tools/ct_metrics/gen_csv_results.py
@@ -12,6 +12,7 @@
import csv
import robot.errors
import re
+import stat
from datetime import datetime
from robot.api import ExecutionResult
from robot.result.visitor import ResultVisitor
@@ -268,6 +269,9 @@
l_writer = csv.writer(l_file, lineterminator='\n')
l_writer.writerows(l_csvlist)
l_file.close()
+ # Set file permissions 666.
+ perm = stat.S_IRUSR + stat.S_IWUSR + stat.S_IRGRP + stat.S_IWGRP + stat.S_IROTH + stat.S_IWOTH
+ os.chmod(l_csvfile, perm)
def xml_to_csv_time(xml_datetime):