aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilosz Wasilewski <milosz.wasilewski@linaro.org>2016-10-06 15:09:21 +0100
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2016-10-06 15:09:21 +0100
commitf71103e70a5c892941230e92498f4cfb72d12b0f (patch)
tree81f8cf635128d212aabbe65b283d96eda3e55b09
parent5abae0ae4c0862eaacf65acab6ad60b2c7cd1244 (diff)
fixes to cts-toolbox
Signed-off-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
-rwxr-xr-xcts-toolbox.py22
-rw-r--r--tools/common.py7
-rw-r--r--tools/cts.py2
3 files changed, 11 insertions, 20 deletions
diff --git a/cts-toolbox.py b/cts-toolbox.py
index f87af17..88995bf 100755
--- a/cts-toolbox.py
+++ b/cts-toolbox.py
@@ -36,16 +36,16 @@ if __name__ == '__main__':
dest="output",
default="results",
help="name of directory to store results (relative to PWD)")
- subparsers = parser.add_subparsers(
- help='sub-command help')
- parser_d = subparsers.add_parser("download",
- help="Download CTS job results from LAVA")
- parser_d.add_argument("-f",
+ parser.add_argument("-f",
"--force",
dest="force",
action="store_true",
default=False,
- help="Force download of already downloaded results")
+ help="Overwrite existing files")
+ subparsers = parser.add_subparsers(
+ help='sub-command help')
+ parser_d = subparsers.add_parser("download",
+ help="Download CTS job results from LAVA")
parser_d.add_argument("-j",
"--job-list",
dest="joblist",
@@ -60,10 +60,6 @@ if __name__ == '__main__':
parser_d.set_defaults(func=download_results)
parser_c = subparsers.add_parser("combine",
help="Combine existing CTS results")
- parser_c.add_argument("-f",
- "--force",
- dest="force",
- help="Force combining of already downloaded results")
parser_c.set_defaults(func=combine_results)
parser_s = subparsers.add_parser("summary",
help="Print summary of CTS results")
@@ -105,12 +101,6 @@ if __name__ == '__main__':
parser_h = subparsers.add_parser("html",
help="Produce modified HTML report from CTS results")
parser_h.set_defaults(func=produce_html)
- parser_h.add_argument("-f",
- "--force",
- dest="force",
- action="store_true",
- default=False,
- help="Force overwriting the HTML report")
args = parser.parse_args()
args.func(args)
diff --git a/tools/common.py b/tools/common.py
index 0d92112..688ee18 100644
--- a/tools/common.py
+++ b/tools/common.py
@@ -1,5 +1,6 @@
+import errno
+import os
import requests
-import shutil
from constants import *
from netrc import netrc
@@ -21,7 +22,7 @@ def get_auth_http(host):
def ensure_output(path):
try:
- shutil.mkdirs(path)
+ os.makedirs(path)
except OSError as exc: # Python >2.5
if exc.errno == errno.EEXIST and os.path.isdir(path):
pass
@@ -33,7 +34,7 @@ def write_to_file(args, filename, content):
ensure_output(basedir)
outfile = os.path.join(basedir, filename)
- if os.path.exists(outfle) and not args.force:
+ if os.path.exists(outfile) and not args.force:
print "{0} exists. Skipping".format(outfile)
else:
with open(outfile, "w") as o:
diff --git a/tools/cts.py b/tools/cts.py
index 6e0b520..04779a4 100644
--- a/tools/cts.py
+++ b/tools/cts.py
@@ -236,7 +236,7 @@ def cts_summary(args, focused_list=None, generate_style=False):
name = name,
ctsrows = cts_styles
)
- write_to_file(args, "cts-{0}.styles".format(name), style_output)
+ write_to_file(args, "cts-{0}.styles".format(name), styles_output)
if args.savecsv:
import csv