mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
Correctly start x-pack trial on ES
This now requires an extra acknowledge parameter to start the trial This changes also makes debugging these issues simpler with better logging during tests Fixes #9584
This commit is contained in:
parent
bf21f97eb3
commit
e072e74d4a
1 changed files with 5 additions and 1 deletions
|
@ -45,6 +45,7 @@ def elasticsearch(options = {})
|
|||
|
||||
# Launch in the background and wait for /started/ stdout
|
||||
cmd = "bin/elasticsearch #{settings_arguments.join(' ')}"
|
||||
puts "Running elasticsearch: #{cmd}"
|
||||
response = Belzebuth.run(cmd, { :directory => get_elasticsearch_path, :wait_condition => /license.*valid/, :timeout => 15 * 60 })
|
||||
unless response.successful?
|
||||
raise "Could not start Elasticsearch, response: #{response}"
|
||||
|
@ -57,7 +58,10 @@ end
|
|||
|
||||
def start_es_xpack_trial
|
||||
if elasticsearch_client.perform_request(:get, '_xpack/license').body['license']['type'] != 'trial'
|
||||
elasticsearch_client.perform_request(:post, '_xpack/license/start_trial')
|
||||
resp = elasticsearch_client.perform_request(:post, '_xpack/license/start_trial', "acknowledge" => true)
|
||||
if resp.body["trial_was_started"] != true
|
||||
raise "Trial not started: #{resp.body}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue