autostacker24 1.0.46 → 1.0.47
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.
- checksums.yaml +4 -4
- data/lib/autostacker24/stacker.rb +8 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f2cad0130b5d54515e7c0a37ce20e1341d13eba
|
4
|
+
data.tar.gz: 2b585c7829a7c866d36318f478d08d32de093249
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1952d619d2bc583c8aef148e46f67f78b9d63559765a81b5f8d458caf7a62f69b0f9a9c09e501a8afd670fcef6e96373eeeb8f474cdb921fe13b07c18406d967
|
7
|
+
data.tar.gz: 151d38554b387e3af9e4b217070a161663137518a8a5bf54565bb8851dc11c1091966486e8ad5bf0b269b80fb4d96a2a84856b31516e6d9203ae9aa6614516ba
|
@@ -41,7 +41,7 @@ module Stacker
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def update_stack(stack_name, template, parameters, parent_stack_name = nil)
|
44
|
-
|
44
|
+
seen_events = get_stack_events(stack_name).map {|e| e[:event_id]}
|
45
45
|
begin
|
46
46
|
merge_and_validate(template, parameters, parent_stack_name)
|
47
47
|
cloud_formation.update_stack(stack_name: stack_name,
|
@@ -79,8 +79,9 @@ module Stacker
|
|
79
79
|
end
|
80
80
|
|
81
81
|
def delete_stack(stack_name)
|
82
|
+
seen_events = get_stack_events(stack_name).map {|e| e[:event_id]}
|
82
83
|
cloud_formation.delete_stack(stack_name: stack_name)
|
83
|
-
wait_for_stack(stack_name, :delete)
|
84
|
+
wait_for_stack(stack_name, :delete, seen_events)
|
84
85
|
end
|
85
86
|
|
86
87
|
def wait_for_stack(stack_name, operation, seen_events = Set.new)
|
@@ -99,12 +100,11 @@ module Stacker
|
|
99
100
|
end
|
100
101
|
return true if status =~ expected_status
|
101
102
|
raise "#{operation} #{stack_name} failed, current status #{status}" if status =~ finished
|
102
|
-
get_stack_events(stack_name).select{|e| !seen_events.include?(e[:event_id]) }
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
}
|
103
|
+
new_events = get_stack_events(stack_name).select{|e| !seen_events.include?(e[:event_id])}.sort_by{|e| e[:timestamp]}
|
104
|
+
new_events.each do |e|
|
105
|
+
seen_events << e[:event_id]
|
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
|
+
end
|
108
108
|
sleep(7)
|
109
109
|
end
|
110
110
|
raise "waiting for #{operation} stack #{stack_name} timed out after #{timeout_in_minutes} minutes"
|