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

Fix #158 validation for buffer_path when buffer_type is 'file' #160

Merged
merged 1 commit into from
Mar 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 3 additions & 2 deletions app/models/fluentd/setting/out_mongo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class OutMongo
KEYS = [
:match,
:host, :port, :database, :collection, :capped, :capped_size, :capped_max, :user, :password, :tag_mapped,
:buffer_type, :buffer_queue_limit, :buffer_chunk_limit, :flush_interval, :retry_wait, :retry_limit, :max_retry_wait, :num_threads,
:buffer_type, :buffer_path, :buffer_queue_limit, :buffer_chunk_limit, :flush_interval, :retry_wait, :retry_limit, :max_retry_wait, :num_threads,
].freeze

attr_accessor(*KEYS)
Expand All @@ -19,6 +19,7 @@ class OutMongo
validates :database, presence: true
validate :validate_capped
validate :validate_collection
validates :buffer_path, presence: true, if: ->{ buffer_type == "file" }

def validate_capped
return true if capped.blank?
Expand Down Expand Up @@ -49,7 +50,7 @@ def common_options

def advanced_options
[
:capped, :capped_size, :capped_max, :buffer_type, :buffer_queue_limit, :buffer_chunk_limit,
:capped, :capped_size, :capped_max, :buffer_type, :buffer_path, :buffer_queue_limit, :buffer_chunk_limit,
:flush_interval, :retry_wait, :retry_limit, :max_retry_wait, :num_threads,
]
end
Expand Down
5 changes: 3 additions & 2 deletions app/models/fluentd/setting/out_s3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class OutS3
# :reduced_redundancy, :check_apikey_on_start, :command_parameter, # not configurable?
:format, :include_time_key, :time_key, :delimiter, :label_delimiter, :add_newline, :output_tag, :output_time,
:time_slice_format, :time_slice_wait, :time_format, :utc, :store_as, :proxy_uri, :use_ssl,
:buffer_type, :buffer_queue_limit, :buffer_chunk_limit, :flush_interval,
:buffer_type, :buffer_path, :buffer_queue_limit, :buffer_chunk_limit, :flush_interval,
:retry_wait, :retry_limit, :max_retry_wait, :num_threads,
].freeze

Expand All @@ -24,6 +24,7 @@ class OutS3

validates :match, presence: true
validates :s3_bucket, presence: true
validates :buffer_path, presence: true, if: ->{ buffer_type == "file" }

def self.initial_params
{
Expand All @@ -45,7 +46,7 @@ def advanced_options
[
:format, :output_tag, :output_time, :include_time_key, :time_key, :delimiter, :label_delimiter,
:utc, :time_slice_format, :time_slice_wait, :store_as, :proxy_uri,
:buffer_type, :buffer_queue_limit, :buffer_chunk_limit, :flush_interval,
:buffer_type, :buffer_path, :buffer_queue_limit, :buffer_chunk_limit, :flush_interval,
:retry_wait, :retry_limit, :max_retry_wait, :num_threads,
]
end
Expand Down
1 change: 1 addition & 0 deletions app/models/fluentd/setting/out_td.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class OutTd
validates :match, presence: true
validates :apikey, presence: true
validates :auto_create_table, presence: true
validates :buffer_path, presence: true, if: ->{ buffer_type == "file" }

def plugin_name
"tdlog"
Expand Down