elasticsearch/esclean.py: add missing schema argument

Fixes:
```
TypeError: __init__() missing 1 required positional argument: 'scheme'
```

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2023-12-04 18:36:40 +01:00
parent 34e5d068a4
commit 5dc408f866
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
1 changed files with 6 additions and 7 deletions

View File

@ -34,7 +34,7 @@ def parse_opts():
help='Delete matching documents.')
parser.add_option('-q', '--query', type='str',
help='Query matching documents.')
return parser.parse_args()
def print_logs(docs):
@ -53,16 +53,15 @@ def main():
(opts, args) = parse_opts()
es = Elasticsearch(
[{ 'host': opts.es_host,
'port': opts.es_port }],
timeout=1200,
hosts=[{ 'host': opts.es_host, 'port': opts.es_port, 'scheme': 'http'}],
request_timeout=1200,
retry_on_timeout=True
)
print('Cluster: {}'.format(es.info().get('cluster_name')))
indices = es.indices.get(index=opts.index_pattern).keys()
queries = []
if opts.tag:
queries.append({'match': {'tags': opts.tag}})