Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dsl: Need '@' prefix for reserved system parameters. fix #2028 #2034

Merged
merged 5 commits into from
Jun 26, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
dsl: Use same name with other module
Signed-off-by: Masahiro Nakagawa <repeatedly@gmail.com>
  • Loading branch information
repeatedly committed Jun 26, 2018
commit afdef8e985d383601507846d51d6a3589e7bebc2
4 changes: 2 additions & 2 deletions lib/fluent/config/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
module Fluent
module Config
module DSL
SYSTEM_PARAM = [:type, :id, :log_level, :label] # Need '@' prefix for reserved parameters
RESERVED_PARAMETERS = [:type, :id, :log_level, :label] # Need '@' prefix for reserved parameters

module Parser
def self.read(path)
Expand Down Expand Up @@ -97,7 +97,7 @@ def method_missing(name, *args, &block)
proxy.element.instance_exec(&block)
@elements.push(proxy.to_config_element)
else
param_name = SYSTEM_PARAM.include?(name) ? "@#{name}" : name.to_s
param_name = RESERVED_PARAMETERS.include?(name) ? "@#{name}" : name.to_s
@attrs[param_name] = if value.is_a?(Array) || value.is_a?(Hash)
JSON.dump(value)
else
Expand Down