Removed unnecessary Password type check

Fixes #8226
This commit is contained in:
Rob Bavey 2017-09-12 18:53:12 -04:00
parent 1ceda5a27f
commit 19fcfe6e3b

View file

@ -69,7 +69,7 @@ module LogStash module Modules class LogStashConfig
password = @settings["var.elasticsearch.password"]
lines = ["hosts => #{hosts}", "index => \"#{index}\""]
lines.push(user ? "user => \"#{user}\"" : nil)
lines.push(password ? "password => \"#{password_value(password)}\"" : nil)
lines.push(password ? "password => \"#{password.value}\"" : nil)
lines.push(type_string ? "document_type => #{type_string}" : nil)
lines.push("ssl => #{@settings.fetch('var.elasticsearch.ssl.enabled', false)}")
if cacert = @settings["var.elasticsearch.ssl.certificate_authority"]
@ -84,10 +84,6 @@ elasticsearch {
CONF
end
def password_value(password)
password.is_a?(LogStash::Util::Password) ? password.value : password
end
def config_string
# process the template and settings
# send back as a string