X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=utils%2Ftest%2Fdashboard%2Fdashboard%2Fcommon%2Felastic_access.py;h=c95a87b3838be29c3355c0bb6d7e51ca9ce52724;hb=6c9775e45460c572850450ef5bd3b02abb181810;hp=b454e9a12bb05641a12233013f107dfcc4ef121a;hpb=84df3462e1efd453ac3a1de6652cb8074da40502;p=releng.git diff --git a/utils/test/dashboard/dashboard/common/elastic_access.py b/utils/test/dashboard/dashboard/common/elastic_access.py index b454e9a12..c95a87b38 100644 --- a/utils/test/dashboard/dashboard/common/elastic_access.py +++ b/utils/test/dashboard/dashboard/common/elastic_access.py @@ -22,14 +22,9 @@ def delete_docs(url, creds=None, body=None): return _request('DELETE', url, creds=creds, body=body) -def publish_docs(docs, creds, to): - json_docs = json.dumps(docs) - if to == 'stdout': - print json_docs - return 200, None - else: - result = _post(to, creds=creds, body=json_docs) - return result.status, result.data +def publish_docs(url, creds=None, body=None): + result = _post(url, creds=creds, body=(json.dumps(body))) + return result.status, result.data def _get_docs_nr(url, creds=None, body=None):