o Add a new method, parse_results_file which takes a file, reads the data and invokes the parse_results method. o Refactor main() method to use parse_results_file. Signed-off-by: Ryan Harper <ryanh@xxxxxxxxxx> --- client/tests/kvm/scan_results.py | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/client/tests/kvm/scan_results.py b/client/tests/kvm/scan_results.py index 95507bd..175744a 100755 --- a/client/tests/kvm/scan_results.py +++ b/client/tests/kvm/scan_results.py @@ -42,6 +42,13 @@ def parse_results(text): return result_list +def parse_results_file(resfile): + f = file(resfile) + text = f.read() + f.close() + return parse_results(text) + + def print_result(result): """Nicely print a single Autotest result. @@ -55,11 +62,7 @@ def main(resfile): print_result(('test', 'status', 'seconds', 'info')) print_result(('----', '------', '-------', '----')) - f = file(resfile) - text = f.read() - f.close() - - results = parse_results(text) + results = parse_results_file(resfile) map(print_result, results) -- 1.6.0.4 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html