aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/functest_utils.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/utils/functest_utils.py b/utils/functest_utils.py
index cb2333d4..d020ebac 100644
--- a/utils/functest_utils.py
+++ b/utils/functest_utils.py
@@ -212,10 +212,10 @@ def push_results_to_db(project, case_name, logger,
logger.debug(r)
return True
except Exception, e:
- print ("Error [push_results_to_db('%s', '%s', '%s', " +
- "'%s', '%s', '%s', '%s', '%s', '%s')]:" %
- (url, project, case_name, pod_name, version,
- scenario, criteria, build_tag, details)), e
+ print("Error [push_results_to_db('%s', '%s', '%s', " +
+ "'%s', '%s', '%s', '%s', '%s', '%s')]:" %
+ (url, project, case_name, pod_name, version,
+ scenario, criteria, build_tag, details)), e
return False
@@ -372,6 +372,19 @@ def check_success_rate(case_name, success_rate):
return status
+def merge_dicts(dict1, dict2):
+ for k in set(dict1.keys()).union(dict2.keys()):
+ if k in dict1 and k in dict2:
+ if isinstance(dict1[k], dict) and isinstance(dict2[k], dict):
+ yield (k, dict(merge_dicts(dict1[k], dict2[k])))
+ else:
+ yield (k, dict2[k])
+ elif k in dict1:
+ yield (k, dict1[k])
+ else:
+ yield (k, dict2[k])
+
+
def check_test_result(test_name, ret, start_time, stop_time):
def get_criteria_value():
return get_criteria_by_test(test_name).split('==')[1].strip()