diff options
Diffstat (limited to 'dashboard/dashboard/common/elastic_access.py')
-rw-r--r-- | dashboard/dashboard/common/elastic_access.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/dashboard/dashboard/common/elastic_access.py b/dashboard/dashboard/common/elastic_access.py index b454e9a..c95a87b 100644 --- a/dashboard/dashboard/common/elastic_access.py +++ b/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): |