Skip to content

Commit

Permalink
Merge pull request #82 from awslabs/fix/aws-sdk-2.5
Browse files Browse the repository at this point in the history
Fix incompatibility for aws-sdk 2.5, specify travis matrix
  • Loading branch information
riywo authored Aug 21, 2016
2 parents 9d50559 + 05cb273 commit 17b89a5
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 34 deletions.
54 changes: 23 additions & 31 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,29 @@
language: ruby

rvm:
- 2.0.0
- 2.1
- 2.2

gemfile:
- Gemfile
- gemfiles/Gemfile.fluentd-0.10.58
- gemfiles/Gemfile.fluentd-0.12

os:
- linux
- osx

before_install:
- gem update bundler

script: bundle exec rake test

sudo: false

matrix:
exclude:
- rvm: 2.0.0
os: osx
- rvm: 2.0.0
include:
- rvm: 2.0.0-p648
os: linux
gemfile: gemfiles/Gemfile.ruby-2.0
- rvm: 2.1.10
os: linux
gemfile: gemfiles/Gemfile.ruby-2.1
- rvm: 2.2.5
os: linux
gemfile: Gemfile
- rvm: 2.3.1
os: linux
gemfile: Gemfile
- rvm: 2.1
os: osx
- rvm: 2.3.1
os: linux
gemfile: gemfiles/Gemfile.fluentd-0.10.58
- rvm: 2.1
os: osx
- rvm: 2.3.1
os: linux
gemfile: gemfiles/Gemfile.fluentd-0.12
- rvm: 2.2
os: osx
- rvm: 2.3.1
os: linux
gemfile: gemfiles/Gemfile.aws-sdk-2.4

script: bundle exec rake test

sudo: false
20 changes: 20 additions & 0 deletions gemfiles/Gemfile.aws-sdk-2.4
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# Copyright 2014-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Amazon Software License (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/asl/
#
# or in the "license" file accompanying this file. This file is distributed
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.

source 'https://rubygems.org'

# Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
gemspec path: ".."

gem "aws-sdk", "~> 2.4.4"
21 changes: 21 additions & 0 deletions gemfiles/Gemfile.ruby-2.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# Copyright 2014-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Amazon Software License (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/asl/
#
# or in the "license" file accompanying this file. This file is distributed
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.

source 'https://rubygems.org'

# Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
gemspec path: ".."

gem "activesupport", "~> 4"
gem "fluentd", "~> 0.12.26"
21 changes: 21 additions & 0 deletions gemfiles/Gemfile.ruby-2.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# Copyright 2014-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Amazon Software License (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/asl/
#
# or in the "license" file accompanying this file. This file is distributed
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.

source 'https://rubygems.org'

# Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
gemspec path: ".."

gem "activesupport", "~> 4"
gem "fluentd", "~> 0.12.26"
6 changes: 3 additions & 3 deletions lib/fluent/plugin/kinesis_helper/credentials.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ def credentials
private

def default_credentials_provider
config_class = Struct.new(:access_key_id, :secret_access_key, :session_token, :profile)
config = config_class.new(@aws_key_id, @aws_sec_key)
config_class = Struct.new(:access_key_id, :secret_access_key, :region, :session_token, :profile)
config = config_class.new(@aws_key_id, @aws_sec_key, @region)
provider = Aws::CredentialProviderChain.new(config).resolve
if provider.nil?
raise Fluent::ConfigError, "You must specify credentials on ~/.aws/credentials, environment variables or IAM role for default credentials"
raise Fluent::ConfigError, "You must specify credentials on ~/.aws/credentials, environment variables or instance profile for default credentials"
end
provider
end
Expand Down
1 change: 1 addition & 0 deletions test/kinesis_helper/test_credentials.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def setup
WebMock.enable!
FakeFS.activate!
@object = Mock.new
Aws.shared_config.fresh
end

def teardown
Expand Down

0 comments on commit 17b89a5

Please sign in to comment.