autostacker24 1.0.43 → 1.0.44

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/autostacker24/stacker.rb +5 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d1fc0440f469c65c70aec62fd69664dfa8303b8
4
- data.tar.gz: b84783fcdb98f0cca751468770905ce32bdb6e1b
3
+ metadata.gz: 4c1865d9c3f5366ce1b5456d4a67600938b37abe
4
+ data.tar.gz: 5c593a9d5cdea96f3c6f24059e0e83417d127cdc
5
5
  SHA512:
6
- metadata.gz: 1402794b59fdfb60e66dbaecac9f761fec7b4179945d7b99753b72c3c881f6b961b5e36d7df4d6a3a4b98c4991ad9685d15aa54c285f9f58eeebe653a39f20f9
7
- data.tar.gz: 0b8b49f21b5c916d95ad7f1d030bbb1354a7d7aafd4fb44785a1c8efe3f11afe422af3d0714ed0ad086489bf400798c325f91ecbcab8347f5910e5f35f3c1a2e
6
+ metadata.gz: f87d6439043c5ebf6f56f4ef0d1482f7dbc74e6c5366eabb1889e08fc098576a54e0b484340d97c6e71779b333c20008fb29057c60fbfdb45d33c465b130091b
7
+ data.tar.gz: 39244b4ec4538ace78c0a9b9e84a187e5fe895906bd2613ce3fe74213cb239d07733593259c5da3bfe946f0846dfd3f883f33ca642c7bb677a0950f767668272
@@ -83,12 +83,14 @@ module Stacker
83
83
  end
84
84
 
85
85
  def wait_for_stack(stack_name, operation, timeout_in_minutes = 15)
86
- start_time = Time.now
87
86
  stop_time = Time.now + timeout_in_minutes * 60
88
87
  finished = /(CREATE_COMPLETE|UPDATE_COMPLETE|DELETE_COMPLETE|ROLLBACK_COMPLETE|ROLLBACK_FAILED|CREATE_FAILED|DELETE_FAILED)$/
89
- seen_events = Array.new
88
+ seen_events = Set.new
90
89
 
91
90
  puts "waiting for #{operation} stack #{stack_name}"
91
+
92
+ get_stack_events(stack_name).each {|e| seen_events << e[:event_id] }
93
+
92
94
  while Time.now < stop_time
93
95
  stack = find_stack(stack_name)
94
96
  status = stack ? stack.stack_status : 'DELETE_COMPLETE'
@@ -99,7 +101,7 @@ module Stacker
99
101
  end
100
102
  return true if status =~ expected_status
101
103
  raise "#{operation} #{stack_name} failed, current status #{status}" if status =~ finished
102
- get_stack_events(stack_name).select{ |e| e[:timestamp] > start_time && !seen_events.include?(e[:event_id]) }
104
+ get_stack_events(stack_name).select{!seen_events.include?(e[:event_id]) }
103
105
  .sort_by{|e| e[:timestamp]}
104
106
  .each{
105
107
  |e| seen_events << e[:event_id]
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.43
4
+ version: 1.0.44
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Mueller