autostacker24 1.0.47 → 1.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/autostacker24/stacker.rb +7 -6
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f2cad0130b5d54515e7c0a37ce20e1341d13eba
4
- data.tar.gz: 2b585c7829a7c866d36318f478d08d32de093249
3
+ metadata.gz: 42647f686035659c63b96b95e07b9f71da3238ee
4
+ data.tar.gz: 039483fb0f458db086405928c3c9052c34258980
5
5
  SHA512:
6
- metadata.gz: 1952d619d2bc583c8aef148e46f67f78b9d63559765a81b5f8d458caf7a62f69b0f9a9c09e501a8afd670fcef6e96373eeeb8f474cdb921fe13b07c18406d967
7
- data.tar.gz: 151d38554b387e3af9e4b217070a161663137518a8a5bf54565bb8851dc11c1091966486e8ad5bf0b269b80fb4d96a2a84856b31516e6d9203ae9aa6614516ba
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
- return true if status =~ expected_status
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
- sleep(7)
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(stack_name)
157
- events = cloud_formation.describe_stack_events(stack_name: stack_name).data.stack_events
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.47
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 00:00:00.000000000 Z
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