summaryrefslogtreecommitdiffstats
path: root/scripts/shared_utils.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2016-06-22 20:46:56 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2016-06-30 11:15:24 +0800
commit448ca7cf1b62a58be3630924d63a684177695390 (patch)
treee3aee0aec7aa14e50d703f8e5370544d301ad8dd /scripts/shared_utils.py
parentc4357b016d8859ad09c009eed071635943ccd012 (diff)
add log info when publish json to elasticsearch failed
add logger.info when publish failed JIRA: FUNCTEST-325 Change-Id: I353001c4305af31dd725e0977ced53d52ba79470 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'scripts/shared_utils.py')
-rw-r--r--scripts/shared_utils.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/shared_utils.py b/scripts/shared_utils.py
index 91ce38e..8bbbdbe 100644
--- a/scripts/shared_utils.py
+++ b/scripts/shared_utils.py
@@ -12,9 +12,11 @@ def publish_json(json_ojb, creds, output_destination):
json_dump = json.dumps(json_ojb)
if output_destination == 'stdout':
print json_dump
+ return 200, None
else:
headers = urllib3.make_headers(basic_auth=creds)
- http.request('POST', output_destination, headers=headers, body=json_dump)
+ result = http.request('POST', output_destination, headers=headers, body=json_dump)
+ return result.status, result.data
def _get_nr_of_hits(elastic_json):