diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2016-08-22 10:50:31 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2016-08-22 18:24:40 +0800 |
commit | 95b85b2da2e60b9b6ed7bfa1c3f457b43e01a524 (patch) | |
tree | ad3b03084ec0b1c1eadc1152db7f9c7c7628be3b /utils/functest_utils.py | |
parent | 9b830f30a6e93643e4aa1312f9439e34f2d74530 (diff) |
bugfix: push_result_to_db exception show
When pod is not exist in DB, exception will be shown as
'Error pushing results into Database '<type 'exceptions.TypeError'>'',
very unclear, make it very difficult to fix the problem.
Modify it to show as the testapi returned
'HTTPError: HTTP 404: Not Found (Could not find pod [zte-no])'
JIRA: FUNCTEST-424
Change-Id: I55fc4639d745b84f6d32a148bd13793d236e2a09
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'utils/functest_utils.py')
-rw-r--r-- | utils/functest_utils.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/utils/functest_utils.py b/utils/functest_utils.py index b83309e3..807a671a 100644 --- a/utils/functest_utils.py +++ b/utils/functest_utils.py @@ -221,6 +221,11 @@ def push_results_to_db(project, case_name, logger, logger.debug(r) r.raise_for_status() return True + except requests.RequestException: + if logger: + logger.error("Pushing Result to DB(%s) failed: %s" % + (r.url, r.content)) + return False except Exception, e: print("Error [push_results_to_db('%s', '%s', '%s', '%s'," "'%s', '%s', '%s', '%s', '%s')]:" % |