Skip to content

Commit e2e4b44

Browse files
author
Patrick Dreker
committed
get rid of unneccessary JSON wrapper around elastic input for pipe
1 parent 12d372f commit e2e4b44

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

elasticcheck.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import json
33
import argparse
44
import sys
5+
import os
56

67
parser = argparse.ArgumentParser(description='Check Elasticsearch Pipelines against testcases')
78
parser.add_argument('--prepare', action='store_true', help='send specified pipelines to elasticsearch')
@@ -14,8 +15,8 @@
1415

1516
if cmdline.prepare:
1617
# input file should have been a pipeline -> send it to elasticsearch
17-
pipeName = jsonInput["name"]
18-
pipelineDefinition = jsonInput["pipeline"]
18+
pipeName, _ = os.path.splitext(os.path.basename(cmdline.pipefile))
19+
pipelineDefinition = jsonInput
1920
url = f'{cmdline.elasticurl}/_ingest/pipeline/{pipeName}'
2021
r = requests.put(url, json=pipelineDefinition)
2122
if r.status_code >= 200 and r.status_code < 300:

0 commit comments

Comments
 (0)