mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
Fix broken plugin tests that didn't have a defined data.home
This is done by providing a default data.home in tmp for environments other than a packaged logstash distro. This is a hack and should be replaced by something better in the future. Fixes #5706
This commit is contained in:
parent
9f9de6dd88
commit
3aa592f46d
1 changed files with 8 additions and 0 deletions
|
@ -3,8 +3,16 @@ require "logstash/errors"
|
|||
require "logstash/config/cpu_core_strategy"
|
||||
require "logstash/settings"
|
||||
require "socket"
|
||||
require "stud/temporary"
|
||||
|
||||
module LogStash
|
||||
# In the event that we're requiring this file without bootstrap/environment.rb
|
||||
if !defined?(LogStash::Environment::LOGSTASH_HOME)
|
||||
module Environment
|
||||
LOGSTASH_HOME = Stud::Temporary.directory("logstash-home")
|
||||
Dir.mkdir(::File.join(LOGSTASH_HOME, "data"))
|
||||
end
|
||||
end
|
||||
|
||||
[
|
||||
Setting::String.new("node.name", Socket.gethostname),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue