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

Refactoring: update mixin-aws version to reuse shared code to manage additional_settings #237

Merged
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 3.8.4
- Refactoring, reuse code to manage `additional_settings` from mixin-aws [#n](https://github.com/logstash-plugins/logstash-input-s3/pull/n)

## 3.8.3
- Fix missing `metadata` and `type` of the last event [#223](https://github.com/logstash-plugins/logstash-input-s3/pull/223)

Expand Down
22 changes: 1 addition & 21 deletions lib/logstash/inputs/s3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -357,25 +357,6 @@ def sincedb_file
path
end

def symbolized_settings
@symbolized_settings ||= symbolize_keys_and_cast_true_false(@additional_settings)
end

def symbolize_keys_and_cast_true_false(hash)
case hash
when Hash
symbolized = {}
hash.each { |key, value| symbolized[key.to_sym] = symbolize_keys_and_cast_true_false(value) }
symbolized
when 'true'
true
when 'false'
false
else
hash
end
end

def ignore_filename?(filename)
if @prefix == filename
return true
Expand Down Expand Up @@ -441,8 +422,7 @@ def delete_file_from_bucket(object)
end

def get_s3object
options = symbolized_settings.merge(aws_options_hash || {})
s3 = Aws::S3::Resource.new(options)
s3 = Aws::S3::Resource.new(aws_options_hash || {})
end

def file_restored?(object)
Expand Down
4 changes: 2 additions & 2 deletions logstash-input-s3.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Gem::Specification.new do |s|

s.name = 'logstash-input-s3'
s.version = '3.8.3'
s.version = '3.8.4'
s.licenses = ['Apache-2.0']
s.summary = "Streams events from files in a S3 bucket"
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
Expand All @@ -21,7 +21,7 @@ Gem::Specification.new do |s|

# Gem dependencies
s.add_runtime_dependency "logstash-core-plugin-api", ">= 2.1.12", "<= 2.99"
s.add_runtime_dependency 'logstash-mixin-aws', '>= 4.3.0'
s.add_runtime_dependency 'logstash-mixin-aws', '>= 5.1.0'
s.add_runtime_dependency 'stud', '~> 0.0.18'
# s.add_runtime_dependency 'aws-sdk-resources', '>= 2.0.33'
s.add_development_dependency 'logstash-devutils'
Expand Down