autostacker24 1.0.47 → 1.0.48
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/autostacker24/stacker.rb +7 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42647f686035659c63b96b95e07b9f71da3238ee
|
4
|
+
data.tar.gz: 039483fb0f458db086405928c3c9052c34258980
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a2fe19be7c32b0fab80e238c392425b934010a1ef04a3d95f30e24b4774c5b4d3b04586e27d94ad8cbe92649e44177d1caaaba7ccab51d7a2a0cc619c911d87
|
7
|
+
data.tar.gz: 3af196507e80f095c405ed06ce7e6a194d5db7ece746cb3d986f7796be388df23e97eff56f5c1a0c525e6e76299cacc99fcae08e91c95af3afc575560ef54a41
|
@@ -89,8 +89,10 @@ module Stacker
|
|
89
89
|
stop_time = Time.now + timeout_in_minutes * 60
|
90
90
|
finished = /(CREATE_COMPLETE|UPDATE_COMPLETE|DELETE_COMPLETE|ROLLBACK_COMPLETE|ROLLBACK_FAILED|CREATE_FAILED|DELETE_FAILED)$/
|
91
91
|
puts "waiting for #{operation} stack #{stack_name}"
|
92
|
+
stack_id = find_stack(stack_name)[:stack_id]
|
92
93
|
|
93
94
|
while Time.now < stop_time
|
95
|
+
sleep(7)
|
94
96
|
stack = find_stack(stack_name)
|
95
97
|
status = stack ? stack.stack_status : 'DELETE_COMPLETE'
|
96
98
|
expected_status = case operation
|
@@ -98,14 +100,13 @@ module Stacker
|
|
98
100
|
when :update then /UPDATE_COMPLETE$/
|
99
101
|
when :delete then /DELETE_COMPLETE$/
|
100
102
|
end
|
101
|
-
|
102
|
-
raise "#{operation} #{stack_name} failed, current status #{status}" if status =~ finished
|
103
|
-
new_events = get_stack_events(stack_name).select{|e| !seen_events.include?(e[:event_id])}.sort_by{|e| e[:timestamp]}
|
103
|
+
new_events = get_stack_events(stack_id).select{|e| !seen_events.include?(e[:event_id])}.sort_by{|e| e[:timestamp]}
|
104
104
|
new_events.each do |e|
|
105
105
|
seen_events << e[:event_id]
|
106
106
|
puts "#{e[:timestamp]}\t#{e[:resource_status].ljust(20)}\t#{e[:resource_type].ljust(40)}\t#{e[:logical_resource_id].ljust(30)}\t#{e[:resource_status_reason]}"
|
107
107
|
end
|
108
|
-
|
108
|
+
return true if status =~ expected_status
|
109
|
+
raise "#{operation} #{stack_name} failed, current status #{status}" if status =~ finished
|
109
110
|
end
|
110
111
|
raise "waiting for #{operation} stack #{stack_name} timed out after #{timeout_in_minutes} minutes"
|
111
112
|
end
|
@@ -153,8 +154,8 @@ module Stacker
|
|
153
154
|
resources.inject({}){|map, resource| map.merge(resource.logical_resource_id.to_sym => resource)}.freeze
|
154
155
|
end
|
155
156
|
|
156
|
-
def get_stack_events(
|
157
|
-
events = cloud_formation.describe_stack_events(stack_name:
|
157
|
+
def get_stack_events(stack_name_or_id)
|
158
|
+
events = cloud_formation.describe_stack_events(stack_name: stack_name_or_id).data.stack_events
|
158
159
|
end
|
159
160
|
|
160
161
|
def cloud_formation # lazy CloudFormation client
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autostacker24
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.48
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johannes Mueller
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-02-
|
12
|
+
date: 2015-02-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aws-sdk-core
|