- clone defaults if necessary, otherwise we might accidentally share the

same 'default' hash instance with all instances of a plugin, and that
  causes problems.

  This fixes a bug found in the grok filter test.
This commit is contained in:
Jordan Sissel 2011-07-01 14:45:50 -07:00
parent 27f501abb8
commit c7d0b24b36

View file

@ -65,7 +65,11 @@ module LogStash::Config::Mixin
@logger.debug("Converting default value in #{self.class.name} (#{name}) to password object")
params[name.to_s] = ::LogStash::Util::Password.new(opts[:default])
else
params[name.to_s] = opts[:default]
default = opts[:default]
if default.is_a?(Array) or default.is_a?(Hash)
default = default.clone
end
params[name.to_s] = default
end
end
end