zergrush_cf 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTM3MzQxNjFkMjI0M2VmZDdjMjA0ZTc2ODI5YjMwYzZkYzc0NjUzMA==
4
+ ZTkyNGMzNzAzMzM0MzVmYzA3ZDJkNDY2ZmQ5ZDZhMDZjNDlhMjFjZA==
5
5
  data.tar.gz: !binary |-
6
- MzE3MjVmZmYzZDlmYzc3ODQ0NTk2YTY5MGU4NWE5MGYwZDkzYzFmMA==
6
+ NmQxMjRhNjAzMWI2MzgyYjM2YjgxZTY5OTQxMzcyNDViMTRkYzA3ZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZWQ3OGJjZGNiZmRhZGZjNDRmNTRmNmQ2ZmNhNzI3MGNlNDAzNTQ4ZGFjM2M4
10
- ZGQyZjhlYWZjODVlODQ5ODRmNjQ0YzJiMTYwNDFkM2FjN2I0OWZiYzFhMWJh
11
- YTFmMzU5Zjg1NjRkNTQwYzU4OWYyYTQ4M2VhMTlkZTRkNzNhNjM=
9
+ MjQ1MGMwOWQ5ZTExMDAwMGQ5NTI1MzYwNjI4YWNlYzg3N2FkYmFmNGEyYmI4
10
+ YjM5ODQzNGE1ZGJjNGYyNzNlYWQyZTI3ZDQ3MWIwYWUxZmI2NDc0ZDI3MTk0
11
+ OGQ4NzEzZTQzODYwNDA4NjE0ZWQxMzkyNGE4MTczNWJjNGJkMTc=
12
12
  data.tar.gz: !binary |-
13
- YTM1ZDhiNTE4MjEzYWFjNjkxMzVlYTIwZmFiOTNmYWFiMzAyMDliODZhNjhi
14
- OTZlNzVmZjg5MGM3MzM5M2NlMjVkNWQ3YzhiNTFmODVlYzQ5NDg2NzRmNTA2
15
- ZWQ0M2E1ZDQwZThjYzYzZTA1ODY4NjMyMTFiOWFlZDVkMjlkMmU=
13
+ MDlmMDNkYzNlMDk2ZWFiZThlNWU0M2E2Y2QyNTZkYTQ1ZGZmNzYyNmU5YTcx
14
+ ZjYwODQ4OTc5NTk2ZmRiZWI5ODg0ZjA1N2RkYTc3MWMxMjFjZDA3MDQ3YWM4
15
+ OTA0MTc5YjM3MmM5OGUwMGViY2M1YTM4YTY2MWJmMTcwZTgxYjc=
@@ -29,6 +29,7 @@ require 'awesome_print'
29
29
  require 'securerandom'
30
30
  require 'bunny'
31
31
  require 'time'
32
+ require 'retries'
32
33
  require_relative 'renderer'
33
34
 
34
35
  class CloudFormation < ZergGemPlugin::Plugin "/driver"
@@ -85,6 +86,10 @@ class CloudFormation < ZergGemPlugin::Plugin "/driver"
85
86
  end
86
87
  end
87
88
 
89
+ Excon.defaults[:connect_timeout] = 600
90
+ Excon.defaults[:read_timeout] = 600
91
+ Excon.defaults[:write_timeout] = 600
92
+
88
93
  cf = Fog::AWS::CloudFormation.new(
89
94
  :aws_access_key_id => aws_key_id,
90
95
  :aws_secret_access_key => aws_secret,
@@ -112,10 +117,15 @@ class CloudFormation < ZergGemPlugin::Plugin "/driver"
112
117
  outputs_info = cf.describe_stacks({ 'StackName' => stack_name })
113
118
  end
114
119
 
115
- events = cf.describe_stack_events(stack_name).body['StackEvents']
116
- while events == nil do
117
- sleep 1
120
+ events = nil
121
+ with_retries(:max_tries => 10, :base_sleep_seconds => 3, :max_sleep_seconds => 20, :rescue => Fog::AWS::CloudFormation::Error) {
118
122
  events = cf.describe_stack_events(stack_name).body['StackEvents']
123
+ }
124
+ while events == nil do
125
+ sleep 3
126
+ with_retries(:max_tries => 10, :base_sleep_seconds => 3, :max_sleep_seconds => 20, :rescue => Fog::AWS::CloudFormation::Error) {
127
+ events = cf.describe_stack_events(stack_name).body['StackEvents']
128
+ }
119
129
  end
120
130
 
121
131
  event_counter = 0
@@ -124,7 +134,9 @@ class CloudFormation < ZergGemPlugin::Plugin "/driver"
124
134
  logRabbitEvents(events.first(events.length - event_counter), rabbit_objects, eval_params(task_hash["vm"]["driver"]["driveroptions"][0]["rabbit"]))
125
135
  event_counter = events.length
126
136
 
127
- events = cf.describe_stack_events(stack_name).body['StackEvents']
137
+ with_retries(:max_tries => 10, :base_sleep_seconds => 3, :max_sleep_seconds => 20, :rescue => Fog::AWS::CloudFormation::Error) {
138
+ events = cf.describe_stack_events(stack_name).body['StackEvents']
139
+ }
128
140
  outputs_info = cf.describe_stacks({ 'StackName' => stack_name })
129
141
  if outputs_info.body["Stacks"][0]["StackStatus"] == "CREATE_COMPLETE"
130
142
  logEvents(events.first(events.length - event_counter))
@@ -172,6 +184,10 @@ class CloudFormation < ZergGemPlugin::Plugin "/driver"
172
184
  # run fog cleanup on the stack.
173
185
  stack_name = "#{task_name}"
174
186
 
187
+ Excon.defaults[:connect_timeout] = 600
188
+ Excon.defaults[:read_timeout] = 600
189
+ Excon.defaults[:write_timeout] = 600
190
+
175
191
  cf = Fog::AWS::CloudFormation.new(
176
192
  :aws_access_key_id => aws_key_id,
177
193
  :aws_secret_access_key => aws_secret,
@@ -196,11 +212,16 @@ class CloudFormation < ZergGemPlugin::Plugin "/driver"
196
212
  end
197
213
  end
198
214
 
199
- events = cf.describe_stack_events(stack_name).body['StackEvents']
215
+ events = nil
216
+ with_retries(:max_tries => 10, :base_sleep_seconds => 3, :max_sleep_seconds => 20, :rescue => Fog::AWS::CloudFormation::Error) {
217
+ events = cf.describe_stack_events(stack_name).body['StackEvents']
218
+ }
200
219
  while events == nil do
201
- sleep 1
220
+ sleep 3
202
221
  begin
203
- events = cf.describe_stack_events(stack_name).body['StackEvents']
222
+ with_retries(:max_tries => 10, :base_sleep_seconds => 3, :max_sleep_seconds => 20, :rescue => Fog::AWS::CloudFormation::Error) {
223
+ events = cf.describe_stack_events(stack_name).body['StackEvents']
224
+ }
204
225
  rescue Fog::AWS::CloudFormation::NotFound
205
226
  rabbit_objects[:connection].close unless rabbit_objects == nil
206
227
  return 0
@@ -214,7 +235,9 @@ class CloudFormation < ZergGemPlugin::Plugin "/driver"
214
235
 
215
236
  event_counter = events.length
216
237
  begin
217
- events = cf.describe_stack_events(stack_name).body['StackEvents']
238
+ with_retries(:max_tries => 10, :base_sleep_seconds => 3, :max_sleep_seconds => 20, :rescue => Fog::AWS::CloudFormation::Error) {
239
+ events = cf.describe_stack_events(stack_name).body['StackEvents']
240
+ }
218
241
  outputs_info = cf.describe_stacks({ 'StackName' => stack_name })
219
242
  rescue Fog::AWS::CloudFormation::NotFound
220
243
  logEvents(events.first(events.length - event_counter))
@@ -22,5 +22,5 @@
22
22
  #++
23
23
 
24
24
  module ZergrushCF
25
- VERSION = "0.0.9"
25
+ VERSION = "0.0.10"
26
26
  end
@@ -17,10 +17,11 @@ Gem::Specification.new do |s|
17
17
 
18
18
  s.add_development_dependency "bundler", ">= 1.0.0"
19
19
  s.add_development_dependency "rake"
20
- s.add_development_dependency "zergrush", ">= 0.0.16"
20
+ s.add_development_dependency "zergrush", ">= 0.0.17"
21
21
 
22
22
  s.add_dependency "fog", ">=1.20.0"
23
23
  s.add_dependency "bunny", ">=1.2.1"
24
+ s.add_dependency "retries", ">=0.0.5"
24
25
 
25
26
  s.files = `git ls-files`.split("\n")
26
27
  s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zergrush_cf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - MTN Satellite Communications
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-13 00:00:00.000000000 Z
11
+ date: 2014-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.0.16
47
+ version: 0.0.17
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.0.16
54
+ version: 0.0.17
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: fog
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ! '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: 1.2.1
83
+ - !ruby/object:Gem::Dependency
84
+ name: retries
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: 0.0.5
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ! '>='
95
+ - !ruby/object:Gem::Version
96
+ version: 0.0.5
83
97
  description: Amazon Cloud Formation driver for zergrush
84
98
  email:
85
99
  - Marat.Garafutdinov@mtnsat.com