autostacker24 1.0.45 → 1.0.46

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 +4 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 99aa62182fdfd0ad454bc66b601f3b96413af369
4
- data.tar.gz: 1b88a3859ad19ac50642ca4d33face79565ce994
3
+ metadata.gz: 4655029e5cf19a37d70d631446ce05ee30a1ee60
4
+ data.tar.gz: 1f76539af6d34ab3cedadb20788227b7cd1cb99c
5
5
  SHA512:
6
- metadata.gz: f5f55a009de8d07cd279cf499aec1b04162f028722d4c0822c6763d9ad94f35e253896213febfb8dc8d9365df66223338e69d03c28704b24083e99697e5594f1
7
- data.tar.gz: afb42a42a826e9a54a0c68186ca65261b4f583009fa592ec8b64f3698030956341fe0e864649e99747d42d759d8c864ad9e3b63cf63b35c9c86d889c8e37b28e
6
+ metadata.gz: f7c868b8f9a15d8178a5c4a4470b9087319024f1c680282789f07c4a461e324d2e03fbff7844957592efb0ec006398059b77701db7217c0c2f46f0ef68d8cb49
7
+ data.tar.gz: a8d88569888862f9888254fc2209104dfb67244d5b53aee21a0e47da5b30baf384665e2e4f1030a3c2d5ea12f119a88c5e780a3c33aaa865e4bec19177887a48
@@ -41,6 +41,7 @@ module Stacker
41
41
  end
42
42
 
43
43
  def update_stack(stack_name, template, parameters, parent_stack_name = nil)
44
+ seen_events = get_stack_events(stack_name).map {|e| e[:event_id] }
44
45
  begin
45
46
  merge_and_validate(template, parameters, parent_stack_name)
46
47
  cloud_formation.update_stack(stack_name: stack_name,
@@ -51,7 +52,7 @@ module Stacker
51
52
  raise error unless error.message =~ /No updates are to be performed/i # may be flaky, do more research in API
52
53
  find_stack(stack_name)
53
54
  else
54
- wait_for_stack(stack_name, :update)
55
+ wait_for_stack(stack_name, :update, seen_events)
55
56
  end
56
57
  end
57
58
 
@@ -82,15 +83,12 @@ module Stacker
82
83
  wait_for_stack(stack_name, :delete)
83
84
  end
84
85
 
85
- def wait_for_stack(stack_name, operation, timeout_in_minutes = 15)
86
+ def wait_for_stack(stack_name, operation, seen_events = Set.new)
87
+ timeout_in_minutes = 60 # for now
86
88
  stop_time = Time.now + timeout_in_minutes * 60
87
89
  finished = /(CREATE_COMPLETE|UPDATE_COMPLETE|DELETE_COMPLETE|ROLLBACK_COMPLETE|ROLLBACK_FAILED|CREATE_FAILED|DELETE_FAILED)$/
88
- seen_events = Set.new
89
-
90
90
  puts "waiting for #{operation} stack #{stack_name}"
91
91
 
92
- get_stack_events(stack_name).each {|e| seen_events << e[:event_id] }
93
-
94
92
  while Time.now < stop_time
95
93
  stack = find_stack(stack_name)
96
94
  status = stack ? stack.stack_status : 'DELETE_COMPLETE'
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.45
4
+ version: 1.0.46
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Mueller