fix bugs and 2.6 compatibility
diff --git a/wally/meta_info.py b/wally/meta_info.py
index 127612b..12cb061 100644
--- a/wally/meta_info.py
+++ b/wally/meta_info.py
@@ -19,8 +19,8 @@
def to_gb(x):
return x / (1024 ** 3)
- lab_data['total_memory'] = format(to_gb(lab_data['total_memory']), ',d')
- lab_data['total_disk'] = format(to_gb(lab_data['total_disk']), ',d')
+ lab_data['total_memory'] = to_gb(lab_data['total_memory'])
+ lab_data['total_disk'] = to_gb(lab_data['total_disk'])
return lab_data
@@ -62,7 +62,6 @@
nodes.append(d)
result['nodes'] = nodes
- # result['name'] = 'Perf-1 Env'
result['fuel_version'] = fuel_version['release']
return result
diff --git a/wally/pretty_yaml.py b/wally/pretty_yaml.py
index 4fc4a49..f078ff2 100644
--- a/wally/pretty_yaml.py
+++ b/wally/pretty_yaml.py
@@ -41,9 +41,9 @@
if isinstance(data, (list, tuple)):
if all(map(is_simple, data)):
if all_nums(data):
- one_line = "[{}]".format(", ".join(map(dumps_simple, data)))
+ one_line = "[{0}]".format(", ".join(map(dumps_simple, data)))
else:
- one_line = "[{}]".format(",".join(map(dumps_simple, data)))
+ one_line = "[{0}]".format(",".join(map(dumps_simple, data)))
else:
one_line = None
diff --git a/wally/report.py b/wally/report.py
index 6164cae..85ac388 100644
--- a/wally/report.py
+++ b/wally/report.py
@@ -1,5 +1,6 @@
import os
import bisect
+import logging
import wally
from wally import charts
@@ -8,6 +9,9 @@
from wally.meta_info import total_lab_info, collect_lab_data
+logger = logging.getLogger("wally.report")
+
+
def render_html(dest, info, lab_description):
very_root_dir = os.path.dirname(os.path.dirname(wally.__file__))
templ_dir = os.path.join(very_root_dir, 'report_templates')
@@ -159,7 +163,12 @@
"processor_count": "None"
}
- processed_results = process_disk_info(results)
- make_plots(processed_results, path)
- di = get_disk_info(processed_results)
- render_html(path, di, lab_info)
+ try:
+ processed_results = process_disk_info(results)
+ make_plots(processed_results, path)
+ di = get_disk_info(processed_results)
+ render_html(path, di, lab_info)
+ except Exception as exc:
+ logger.error("Failed to generate html report:" + exc.message)
+ else:
+ logger.info("Html report were stored in " + path)
diff --git a/wally/run_test.py b/wally/run_test.py
index 96b8af2..d578349 100755
--- a/wally/run_test.py
+++ b/wally/run_test.py
@@ -79,9 +79,9 @@
def test_thread(test, node, barrier, res_q):
try:
- logger.debug("Run preparation for {0}".format(node.conn_url))
+ logger.debug("Run preparation for {0}".format(node.get_conn_id()))
test.pre_run(node.connection)
- logger.debug("Run test for {0}".format(node.conn_url))
+ logger.debug("Run test for {0}".format(node.get_conn_id()))
test.run(node.connection, barrier)
except Exception as exc:
logger.exception("In test {0} for node {1}".format(test, node))
@@ -125,7 +125,7 @@
os.makedirs(dr)
test = tool_type_mapper[name](params, res_q.put, dr,
- node=node.get_ip())
+ node=node.get_conn_id())
th = threading.Thread(None, test_thread, None,
(test, node, barrier, res_q))
threads.append(th)
@@ -392,8 +392,6 @@
report.make_io_report(ctx.results, html_rep_fname, fuel_url, creds=creds)
- logger.info("Html report were stored in " + html_rep_fname)
-
text_rep_fname = cfg_dict['text_report_file']
with open(text_rep_fname, "w") as fd:
for tp, data in ctx.results:
@@ -439,6 +437,8 @@
parser.add_argument("-d", '--dont-discover-nodes', action='store_true',
help="Don't connect/discover fuel nodes",
default=False)
+ parser.add_argument("-r", '--no-html-report', action='store_true',
+ help="Skip html report", default=False)
parser.add_argument("config_file")
return parser.parse_args(argv[1:])
@@ -463,9 +463,11 @@
report_stages = [
console_report_stage,
- html_report_stage
]
+ if not opts.no_html_report:
+ report_stages.append(html_report_stage)
+
load_config(opts.config_file, opts.post_process_only)
if cfg_dict.get('logging', {}).get("extra_logs", False) or opts.extra_logs: