fog-aws 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +34 -0
- data/fog-aws.gemspec +1 -1
- data/lib/fog/aws/credential_fetcher.rb +3 -0
- data/lib/fog/aws/models/dns/records.rb +1 -1
- data/lib/fog/aws/parsers/auto_scaling/describe_launch_configurations.rb +2 -1
- data/lib/fog/aws/parsers/cloud_formation/describe_stacks.rb +15 -2
- data/lib/fog/aws/parsers/cloud_watch/describe_alarms.rb +46 -14
- data/lib/fog/aws/parsers/storage/get_bucket.rb +1 -1
- data/lib/fog/aws/requests/storage/put_bucket.rb +2 -1
- data/lib/fog/aws/version.rb +1 -1
- data/tests/credentials_tests.rb +4 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0361bb136f825209f65c1e570b023e6f2b74d865
|
4
|
+
data.tar.gz: 043f9727f53b0c68c6648bac38bf35bb13354590
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89aa0ad3aadc59b08fd8e5969cefc1b4afa9cc04297836406139fdb47ecb2aa2c2ea6a3e330bca0de37942c46c01d23467a402df2e1a961084d838858af3bb30
|
7
|
+
data.tar.gz: 2f5414ddd22a1a99bcfc16b0deb5aef69f632ee4e04b754a7693d412f2b226a1cea3c0bcd7e40533560a3b89d2b2f9879ab2f86c3c1faeb00d0b235b4746bba1
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,39 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [Unreleased](https://github.com/fog/fog-aws/tree/HEAD)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/fog/fog-aws/compare/v0.9.2...HEAD)
|
6
|
+
|
7
|
+
**Closed issues:**
|
8
|
+
|
9
|
+
- Users list is empty in Fog::AWS::IAM::Groups [\#256](https://github.com/fog/fog-aws/issues/256)
|
10
|
+
- I'd like to configure my Excon read\_timeout and write\_timeout [\#254](https://github.com/fog/fog-aws/issues/254)
|
11
|
+
- Bump fog-core to \>=1.38.0 [\#247](https://github.com/fog/fog-aws/issues/247)
|
12
|
+
- no implicit conversion of Array into String in `aws/storage.rb` from `bucket\_name` in params. [\#246](https://github.com/fog/fog-aws/issues/246)
|
13
|
+
- \[S3\] Bucket name gets duplicated in case of redirect from AWS [\#242](https://github.com/fog/fog-aws/issues/242)
|
14
|
+
- CloudFormation stack tags cause describe\_stacks to break [\#240](https://github.com/fog/fog-aws/issues/240)
|
15
|
+
|
16
|
+
**Merged pull requests:**
|
17
|
+
|
18
|
+
- Parse EbsOptimized parameter in launch configuration description [\#259](https://github.com/fog/fog-aws/pull/259) ([djudd](https://github.com/djudd))
|
19
|
+
- Allow case-insensitive record comparison [\#258](https://github.com/fog/fog-aws/pull/258) ([mpick92](https://github.com/mpick92))
|
20
|
+
- Fix for empty ETag values [\#257](https://github.com/fog/fog-aws/pull/257) ([baryshev](https://github.com/baryshev))
|
21
|
+
- do not make requests if mocked. [\#252](https://github.com/fog/fog-aws/pull/252) ([shaiguitar](https://github.com/shaiguitar))
|
22
|
+
- Parse CloudWatch alarm actions as arrays instead of strings [\#245](https://github.com/fog/fog-aws/pull/245) ([eherot](https://github.com/eherot))
|
23
|
+
- Add support for CloudFormation stack tags. [\#241](https://github.com/fog/fog-aws/pull/241) ([jamesremuscat](https://github.com/jamesremuscat))
|
24
|
+
- Add log warning message about when not on us-region [\#200](https://github.com/fog/fog-aws/pull/200) ([kitofr](https://github.com/kitofr))
|
25
|
+
|
26
|
+
## [v0.9.2](https://github.com/fog/fog-aws/tree/v0.9.2) (2016-03-23)
|
27
|
+
[Full Changelog](https://github.com/fog/fog-aws/compare/v0.9.1...v0.9.2)
|
28
|
+
|
29
|
+
**Closed issues:**
|
30
|
+
|
31
|
+
- CHANGELOG.md is out of date [\#235](https://github.com/fog/fog-aws/issues/235)
|
32
|
+
|
33
|
+
**Merged pull requests:**
|
34
|
+
|
35
|
+
- Aurora [\#238](https://github.com/fog/fog-aws/pull/238) ([ehowe](https://github.com/ehowe))
|
36
|
+
|
3
37
|
## [v0.9.1](https://github.com/fog/fog-aws/tree/v0.9.1) (2016-03-04)
|
4
38
|
[Full Changelog](https://github.com/fog/fog-aws/compare/v0.8.2...v0.9.1)
|
5
39
|
|
data/fog-aws.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_development_dependency 'shindo', '~> 0.3'
|
25
25
|
spec.add_development_dependency 'rubyzip', '~> 0.9.9'
|
26
26
|
|
27
|
-
spec.add_dependency 'fog-core', '~> 1.
|
27
|
+
spec.add_dependency 'fog-core', '~> 1.38'
|
28
28
|
spec.add_dependency 'fog-json', '~> 1.0'
|
29
29
|
spec.add_dependency 'fog-xml', '~> 0.1'
|
30
30
|
spec.add_dependency 'ipaddress', '~> 0.8'
|
@@ -5,6 +5,9 @@ module Fog
|
|
5
5
|
INSTANCE_METADATA_PATH = "/latest/meta-data/iam/security-credentials/"
|
6
6
|
module ServiceMethods
|
7
7
|
def fetch_credentials(options)
|
8
|
+
if options[:use_iam_profile] && Fog.mocking?
|
9
|
+
Fog::Compute::AWS::Mock.data[:iam_role_based_creds]
|
10
|
+
end
|
8
11
|
if options[:use_iam_profile]
|
9
12
|
begin
|
10
13
|
connection = options[:connection] || Excon.new(INSTANCE_METADATA_HOST)
|
@@ -93,7 +93,7 @@ module Fog
|
|
93
93
|
(data['ResourceRecordSets'] || []).map do |record_data|
|
94
94
|
record = new(record_data)
|
95
95
|
|
96
|
-
if (record.name ==
|
96
|
+
if (record.name.casecmp(record_name) == 0) &&
|
97
97
|
(record_type.nil? || (record.type == record_type)) &&
|
98
98
|
(record_identifier.nil? || (record.set_identifier == record_identifier))
|
99
99
|
record
|
@@ -4,9 +4,10 @@ module Fog
|
|
4
4
|
module CloudFormation
|
5
5
|
class DescribeStacks < Fog::Parsers::Base
|
6
6
|
def reset
|
7
|
-
@stack = { 'Outputs' => [], 'Parameters' => [], 'Capabilities' => [] }
|
7
|
+
@stack = { 'Outputs' => [], 'Parameters' => [], 'Capabilities' => [], 'Tags' => [] }
|
8
8
|
@output = {}
|
9
9
|
@parameter = {}
|
10
|
+
@tag = {}
|
10
11
|
@response = { 'Stacks' => [] }
|
11
12
|
end
|
12
13
|
|
@@ -19,6 +20,8 @@ module Fog
|
|
19
20
|
@in_parameters = true
|
20
21
|
when 'Capabilities'
|
21
22
|
@in_capabilities = true
|
23
|
+
when 'Tags'
|
24
|
+
@in_tags = true
|
22
25
|
end
|
23
26
|
end
|
24
27
|
|
@@ -43,6 +46,16 @@ module Fog
|
|
43
46
|
when 'Parameters'
|
44
47
|
@in_parameters = false
|
45
48
|
end
|
49
|
+
elsif @in_tags
|
50
|
+
case name
|
51
|
+
when 'Key', 'Value'
|
52
|
+
@tag[name] = value
|
53
|
+
when 'member'
|
54
|
+
@stack['Tags'] << @tag
|
55
|
+
@tag = {}
|
56
|
+
when 'Tags'
|
57
|
+
@in_tags = false
|
58
|
+
end
|
46
59
|
elsif @in_capabilities
|
47
60
|
case name
|
48
61
|
when 'member'
|
@@ -54,7 +67,7 @@ module Fog
|
|
54
67
|
case name
|
55
68
|
when 'member'
|
56
69
|
@response['Stacks'] << @stack
|
57
|
-
@stack = { 'Outputs' => [], 'Parameters' => [], 'Capabilities' => []}
|
70
|
+
@stack = { 'Outputs' => [], 'Parameters' => [], 'Capabilities' => [], 'Tags' => []}
|
58
71
|
when 'RequestId'
|
59
72
|
@response[name] = value
|
60
73
|
when 'CreationTime'
|
@@ -9,22 +9,46 @@ module Fog
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def reset_metric_alarms
|
12
|
-
@metric_alarms = {
|
12
|
+
@metric_alarms = {
|
13
|
+
'Dimensions' => [],
|
14
|
+
'AlarmActions' => [],
|
15
|
+
'OKActions' => [],
|
16
|
+
'InsufficientDataActions' => []
|
17
|
+
}
|
13
18
|
end
|
14
19
|
|
15
20
|
def reset_dimension
|
16
21
|
@dimension = {}
|
17
22
|
end
|
18
23
|
|
24
|
+
def reset_alarm_actions
|
25
|
+
@alarm_actions = {}
|
26
|
+
end
|
27
|
+
|
28
|
+
def reset_ok_actions
|
29
|
+
@ok_actions = {}
|
30
|
+
end
|
31
|
+
|
32
|
+
def reset_insufficient_data_actions
|
33
|
+
@insufficient_data_actions = {}
|
34
|
+
end
|
35
|
+
|
19
36
|
def start_element(name, attrs = [])
|
20
37
|
super
|
21
38
|
case name
|
22
39
|
when 'Dimensions'
|
23
40
|
@in_dimensions = true
|
41
|
+
when 'AlarmActions'
|
42
|
+
@in_alarm_actions = true
|
43
|
+
when 'OKActions'
|
44
|
+
@in_ok_actions = true
|
45
|
+
when 'InsufficientDataActions'
|
46
|
+
@in_insufficient_data_actions = true
|
24
47
|
when 'member'
|
25
|
-
if @in_dimensions
|
26
|
-
|
27
|
-
|
48
|
+
reset_dimension if @in_dimensions
|
49
|
+
reset_alarm_actions if @in_alarm_actions
|
50
|
+
reset_ok_actions if @in_ok_actions
|
51
|
+
reset_insufficient_data_actions if @in_insufficient_data_actions
|
28
52
|
end
|
29
53
|
end
|
30
54
|
|
@@ -38,8 +62,12 @@ module Fog
|
|
38
62
|
@metric_alarms[name] = value.to_i
|
39
63
|
when 'Threshold'
|
40
64
|
@metric_alarms[name] = value.to_f
|
41
|
-
when 'AlarmActions'
|
42
|
-
@
|
65
|
+
when 'AlarmActions'
|
66
|
+
@in_alarm_actions = false
|
67
|
+
when 'OKActions'
|
68
|
+
@in_ok_actions = false
|
69
|
+
when 'InsufficientDataActions'
|
70
|
+
@in_insufficient_data_actions = false
|
43
71
|
when 'AlarmName', 'Namespace', 'MetricName', 'AlarmDescription', 'AlarmArn', 'Unit',
|
44
72
|
'StateValue', 'Statistic', 'ComparisonOperator', 'StateReason', 'ActionsEnabled'
|
45
73
|
@metric_alarms[name] = value
|
@@ -52,15 +80,19 @@ module Fog
|
|
52
80
|
when 'NextToken'
|
53
81
|
@response['ResponseMetadata'][name] = value
|
54
82
|
when 'member'
|
55
|
-
if
|
56
|
-
if @metric_alarms.key?('AlarmName')
|
57
|
-
@response['DescribeAlarmsResult']['MetricAlarms'] << @metric_alarms
|
58
|
-
reset_metric_alarms
|
59
|
-
elsif @response['DescribeAlarmsResult']['MetricAlarms'].last != nil
|
60
|
-
@response['DescribeAlarmsResult']['MetricAlarms'].last.merge!( @metric_alarms)
|
61
|
-
end
|
62
|
-
else
|
83
|
+
if @in_dimensions
|
63
84
|
@metric_alarms['Dimensions'] << @dimension
|
85
|
+
elsif @in_alarm_actions
|
86
|
+
@metric_alarms['AlarmActions'] << value.to_s.strip
|
87
|
+
elsif @in_ok_actions
|
88
|
+
@metric_alarms['OKActions'] << value.to_s.strip
|
89
|
+
elsif @in_insufficient_data_actions
|
90
|
+
@metric_alarms['InsufficientDataActions'] << value.to_s.strip
|
91
|
+
elsif @metric_alarms.key?('AlarmName')
|
92
|
+
@response['DescribeAlarmsResult']['MetricAlarms'] << @metric_alarms
|
93
|
+
reset_metric_alarms
|
94
|
+
elsif @response['DescribeAlarmsResult']['MetricAlarms'].last != nil
|
95
|
+
@response['DescribeAlarmsResult']['MetricAlarms'].last.merge!( @metric_alarms)
|
64
96
|
end
|
65
97
|
end
|
66
98
|
end
|
@@ -26,7 +26,7 @@ module Fog
|
|
26
26
|
when 'DisplayName', 'ID'
|
27
27
|
@object['Owner'][name] = value
|
28
28
|
when 'ETag'
|
29
|
-
@object[name] = value.gsub('"', '')
|
29
|
+
@object[name] = value.gsub('"', '') if value != nil
|
30
30
|
when 'IsTruncated'
|
31
31
|
if value == 'true'
|
32
32
|
@response['IsTruncated'] = true
|
@@ -63,7 +63,8 @@ DATA
|
|
63
63
|
self.data[:buckets][bucket_name] = bucket
|
64
64
|
elsif self.region != 'us-east-1'
|
65
65
|
response.status = 409
|
66
|
-
|
66
|
+
Fog::Logger.warning "Your region '#{self.region}' does not match the default region 'us-east-1'"
|
67
|
+
raise(Excon::Errors.status_error({:expects => 201}, response))
|
67
68
|
end
|
68
69
|
response
|
69
70
|
end
|
data/lib/fog/aws/version.rb
CHANGED
data/tests/credentials_tests.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
Shindo.tests('AWS | credentials', ['aws']) do
|
2
2
|
old_mock_value = Excon.defaults[:mock]
|
3
|
+
fog_was_mocked = Fog.mocking?
|
3
4
|
Excon.stubs.clear
|
4
|
-
|
5
|
+
Fog.mock!
|
5
6
|
begin
|
6
7
|
Excon.defaults[:mock] = true
|
7
8
|
default_credentials = Fog::Compute::AWS.fetch_credentials({})
|
@@ -15,6 +16,7 @@ Shindo.tests('AWS | credentials', ['aws']) do
|
|
15
16
|
'Expiration' => expires_at.xmlschema
|
16
17
|
}
|
17
18
|
|
19
|
+
Fog::Compute::AWS::Mock.data[:iam_role_based_creds] = credentials
|
18
20
|
Excon.stub({:method => :get, :path => "/latest/meta-data/iam/security-credentials/arole"}, {:status => 200, :body => Fog::JSON.encode(credentials)})
|
19
21
|
|
20
22
|
tests("#fetch_credentials") do
|
@@ -51,5 +53,6 @@ Shindo.tests('AWS | credentials', ['aws']) do
|
|
51
53
|
ensure
|
52
54
|
Excon.stubs.clear
|
53
55
|
Excon.defaults[:mock] = old_mock_value
|
56
|
+
Fog.unmock! if !fog_was_mocked
|
54
57
|
end
|
55
58
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-aws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Lane
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-06-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -73,14 +73,14 @@ dependencies:
|
|
73
73
|
requirements:
|
74
74
|
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: '1.
|
76
|
+
version: '1.38'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
81
|
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: '1.
|
83
|
+
version: '1.38'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: fog-json
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1610,7 +1610,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1610
1610
|
version: '0'
|
1611
1611
|
requirements: []
|
1612
1612
|
rubyforge_project:
|
1613
|
-
rubygems_version: 2.5.
|
1613
|
+
rubygems_version: 2.5.1
|
1614
1614
|
signing_key:
|
1615
1615
|
specification_version: 4
|
1616
1616
|
summary: Module for the 'fog' gem to support Amazon Web Services.
|