From dd9e8643b72497eecdb4c80dc64f161b1562033b Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Fri, 9 Sep 2016 16:50:48 +0800 Subject: Fix security issues of eval-s in testapi results from security audit show risks and recommendations to fix them JIRA: RELENG-144 Change-Id: If128cc3ae230150a912b581dfb1ded543d851eb5 Signed-off-by: SerenaFeng --- .../opnfv_testapi/dashboard/promise2Dashboard.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'utils/test/result_collection_api/opnfv_testapi/dashboard/promise2Dashboard.py') diff --git a/utils/test/result_collection_api/opnfv_testapi/dashboard/promise2Dashboard.py b/utils/test/result_collection_api/opnfv_testapi/dashboard/promise2Dashboard.py index 84f43a7d1..c96341f6d 100644 --- a/utils/test/result_collection_api/opnfv_testapi/dashboard/promise2Dashboard.py +++ b/utils/test/result_collection_api/opnfv_testapi/dashboard/promise2Dashboard.py @@ -14,9 +14,6 @@ # a new method format__for_dashboard(results) # v0.1: basic example with methods for odl, Tempest, Rally and vPing # -import re -import datetime - def get_promise_cases(): """ @@ -36,8 +33,8 @@ def format_promise_for_dashboard(case, results): # note we add _case because testcase and project had the same name # TODO refactoring...looks fine at the beginning wit only 1 project # not very ugly now and clearly not optimized... - cmd = "format_" + case + "_case_for_dashboard(results)" - res = eval(cmd) + cmd = "format_" + case + "_case_for_dashboard" + res = globals()[cmd](results) else: res = [] print "Test cases not declared" -- cgit 1.2.3-korg