opendelivery 0.0.12 → 0.0.13

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 (2) hide show
  1. data/lib/opendelivery/stack.rb +51 -51
  2. metadata +1 -1
@@ -72,71 +72,71 @@ module OpenDelivery
72
72
  end
73
73
  @domain.destroy_item(domain, stack_name)
74
74
  end
75
+ end
75
76
 
76
- def list
77
- @cfn.stacks.each do |stack|
78
- puts "Stack Name: #{stack.name} | Status: #{stack.status}"
79
- end
77
+ def list
78
+ @cfn.stacks.each do |stack|
79
+ puts "Stack Name: #{stack.name} | Status: #{stack.status}"
80
80
  end
81
+ end
81
82
 
82
- protected
83
+ protected
83
84
 
84
- def wait_for_stack(stack)
85
- while stack.status != "CREATE_COMPLETE"
86
- sleep 20
85
+ def wait_for_stack(stack)
86
+ while stack.status != "CREATE_COMPLETE"
87
+ sleep 20
87
88
 
88
- if FAILURE_STATUSES.include? stack.status
89
- stack.delete
90
- end
89
+ if FAILURE_STATUSES.include? stack.status
90
+ stack.delete
91
91
  end
92
92
  end
93
+ end
93
94
 
94
- def print_status(status, silent)
95
- timestamp = Time.now.strftime("%Y.%m.%d %H:%M:%S:%L")
96
- unless silent
97
- puts "#{timestamp}: #{status}"
98
- end
95
+ def print_status(status, silent)
96
+ timestamp = Time.now.strftime("%Y.%m.%d %H:%M:%S:%L")
97
+ unless silent
98
+ puts "#{timestamp}: #{status}"
99
99
  end
100
+ end
100
101
 
101
- def watch_loop(stack, sleep_time, silent)
102
- keep_watching = true
103
- success = false
104
- abort_count = 10
105
- while(keep_watching) do
106
- begin
107
- stack_status = stack.status
108
- if (SUCCESS_STATUSES.include? stack_status)
109
- status = "Success: #{stack_status}"
110
- print_status(status, silent)
111
- success = true
112
- keep_watching = false
113
- elsif (PROGRESS_STATUSES.include? stack_status)
114
- status = "In Progress: #{stack_status}"
115
- print_status(status, silent)
116
- success = false
117
- keep_watching = true
118
- elsif (FAILURE_STATUSES.include? stack_status)
119
- status = "Failed: #{stack_status}"
120
- print_status(status, silent)
121
- success = false
122
- keep_watching = false
123
- else
124
- status = "didn't find #{stack_status} in the list of expected statuses"
125
- print_status(status, silent)
126
- success = false
127
- abort_count = abort_count - 1
128
- # if we get too many unknown statuses, assume something has gone horribly wrong and quit.
129
- keep_watching = (abort_count > 0)
130
- end
131
- rescue AWS::CloudFormation::Errors::Throttling
132
- status = "Rate limit exceeded, retrying..."
102
+ def watch_loop(stack, sleep_time, silent)
103
+ keep_watching = true
104
+ success = false
105
+ abort_count = 10
106
+ while(keep_watching) do
107
+ begin
108
+ stack_status = stack.status
109
+ if (SUCCESS_STATUSES.include? stack_status)
110
+ status = "Success: #{stack_status}"
111
+ print_status(status, silent)
112
+ success = true
113
+ keep_watching = false
114
+ elsif (PROGRESS_STATUSES.include? stack_status)
115
+ status = "In Progress: #{stack_status}"
133
116
  print_status(status, silent)
134
- sleep (sleep_time * 0.1)
117
+ success = false
118
+ keep_watching = true
119
+ elsif (FAILURE_STATUSES.include? stack_status)
120
+ status = "Failed: #{stack_status}"
121
+ print_status(status, silent)
122
+ success = false
123
+ keep_watching = false
124
+ else
125
+ status = "didn't find #{stack_status} in the list of expected statuses"
126
+ print_status(status, silent)
127
+ success = false
128
+ abort_count = abort_count - 1
129
+ # if we get too many unknown statuses, assume something has gone horribly wrong and quit.
130
+ keep_watching = (abort_count > 0)
135
131
  end
136
- sleep(sleep_time)
132
+ rescue AWS::CloudFormation::Errors::Throttling
133
+ status = "Rate limit exceeded, retrying..."
134
+ print_status(status, silent)
135
+ sleep (sleep_time * 0.1)
137
136
  end
138
- return success
137
+ sleep(sleep_time)
139
138
  end
139
+ return success
140
140
  end
141
141
  end
142
142
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opendelivery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: