ey_enzyme 0.9.40 → 0.9.41

Sign up to get free protection for your applications and to get access to all the features.
data/lib/ey_enzyme/api.rb CHANGED
@@ -5,7 +5,7 @@ module EY::Enzyme
5
5
  @instance_id = instance_id
6
6
  @token = token
7
7
  @logger = MultiLogger.new(log_file)
8
- @rest = RestClient::Resource.new(api_url)
8
+ @rest = RestClient::Resource.new(api_url, :timeout => api_rest_timeout_seconds)
9
9
  end
10
10
 
11
11
  def report(message)
@@ -60,16 +60,29 @@ module EY::Enzyme
60
60
 
61
61
  def call_api(path, opts={})
62
62
  @logger.debug "API call path: #{path.inspect}, data: #{opts.inspect}"
63
- JSON.parse(@rest[path].post(opts.merge(keys).to_json, {"Content-Type" => "application/json", "Accept" => "application/json"}))
63
+ JSON.parse(@rest[path].post(opts.merge(keys).to_json,
64
+ {"Content-Type" => "application/json", "Accept" => "application/json"}))
65
+ end
66
+
67
+ def api_rest_timeout_seconds
68
+ 60
69
+ end
70
+
71
+ def api_max_total_seconds
72
+ 10 * 60
73
+ end
74
+
75
+ def api_sleep_before_retry_seconds
76
+ 30
64
77
  end
65
78
 
66
79
  def retry_api(path, opts={})
67
- Timeout.timeout(10 * 60) do
80
+ Timeout.timeout(api_max_total_seconds) do
68
81
  loop do
69
82
  if result = safe_api(path, opts)
70
83
  return result
71
84
  end
72
- sleep 5
85
+ sleep api_sleep_before_retry_seconds
73
86
  end
74
87
  end
75
88
  rescue Timeout::Error
data/lib/ey_enzyme/cli.rb CHANGED
@@ -134,7 +134,8 @@ module EY::Enzyme
134
134
  end
135
135
 
136
136
  def custom_cookbooks
137
- @custom_cookbooks ||= CookbookSet.new(@opts, "custom", CUSTOM_RECIPE_PATH, @api.custom_recipe_url, @api)
137
+ url = @opts.has_key?(:custom_recipes_url) ? @opts[:custom_recipes_url] : @api.custom_recipe_url
138
+ @custom_cookbooks ||= CookbookSet.new(@opts, "custom", CUSTOM_RECIPE_PATH, url, @api)
138
139
  end
139
140
 
140
141
  def update_dna
@@ -1,5 +1,5 @@
1
1
  module EY
2
2
  module Enzyme
3
- VERSION = "0.9.40"
3
+ VERSION = "0.9.41"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,8 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ey_enzyme
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 105
4
5
  prerelease:
5
- version: 0.9.40
6
+ segments:
7
+ - 0
8
+ - 9
9
+ - 41
10
+ version: 0.9.41
6
11
  platform: ruby
7
12
  authors:
8
13
  - Engine Yard Inc.
@@ -10,8 +15,7 @@ autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2010-02-25 00:00:00 -04:00
14
- default_executable:
18
+ date: 2010-02-25 00:00:00 Z
15
19
  dependencies:
16
20
  - !ruby/object:Gem::Dependency
17
21
  name: json
@@ -21,6 +25,9 @@ dependencies:
21
25
  requirements:
22
26
  - - ">="
23
27
  - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
24
31
  version: "0"
25
32
  type: :runtime
26
33
  version_requirements: *id001
@@ -32,6 +39,11 @@ dependencies:
32
39
  requirements:
33
40
  - - ~>
34
41
  - !ruby/object:Gem::Version
42
+ hash: 13
43
+ segments:
44
+ - 1
45
+ - 6
46
+ - 1
35
47
  version: 1.6.1
36
48
  type: :runtime
37
49
  version_requirements: *id002
@@ -43,6 +55,12 @@ dependencies:
43
55
  requirements:
44
56
  - - "="
45
57
  - !ruby/object:Gem::Version
58
+ hash: 123
59
+ segments:
60
+ - 0
61
+ - 6
62
+ - 0
63
+ - 2
46
64
  version: 0.6.0.2
47
65
  type: :runtime
48
66
  version_requirements: *id003
@@ -54,6 +72,11 @@ dependencies:
54
72
  requirements:
55
73
  - - "="
56
74
  - !ruby/object:Gem::Version
75
+ hash: 29
76
+ segments:
77
+ - 0
78
+ - 2
79
+ - 5
57
80
  version: 0.2.5
58
81
  type: :runtime
59
82
  version_requirements: *id004
@@ -65,6 +88,11 @@ dependencies:
65
88
  requirements:
66
89
  - - ~>
67
90
  - !ruby/object:Gem::Version
91
+ hash: 29
92
+ segments:
93
+ - 0
94
+ - 2
95
+ - 5
68
96
  version: 0.2.5
69
97
  type: :runtime
70
98
  version_requirements: *id005
@@ -76,6 +104,9 @@ dependencies:
76
104
  requirements:
77
105
  - - ">="
78
106
  - !ruby/object:Gem::Version
107
+ hash: 3
108
+ segments:
109
+ - 0
79
110
  version: "0"
80
111
  type: :development
81
112
  version_requirements: *id006
@@ -87,6 +118,10 @@ dependencies:
87
118
  requirements:
88
119
  - - ~>
89
120
  - !ruby/object:Gem::Version
121
+ hash: 11
122
+ segments:
123
+ - 1
124
+ - 2
90
125
  version: "1.2"
91
126
  type: :development
92
127
  version_requirements: *id007
@@ -98,6 +133,9 @@ dependencies:
98
133
  requirements:
99
134
  - - ">="
100
135
  - !ruby/object:Gem::Version
136
+ hash: 3
137
+ segments:
138
+ - 0
101
139
  version: "0"
102
140
  type: :development
103
141
  version_requirements: *id008
@@ -109,6 +147,9 @@ dependencies:
109
147
  requirements:
110
148
  - - ">="
111
149
  - !ruby/object:Gem::Version
150
+ hash: 3
151
+ segments:
152
+ - 0
112
153
  version: "0"
113
154
  type: :development
114
155
  version_requirements: *id009
@@ -129,14 +170,13 @@ files:
129
170
  - lib/ey_enzyme/old_cli.rb
130
171
  - lib/ey_enzyme/version.rb
131
172
  - lib/ey_enzyme.rb
173
+ - bin/ey-enzyme
174
+ - bin/ey-recipes
132
175
  - spec/api_spec.rb
133
176
  - spec/log_upload_error_notify_spec.rb
134
177
  - spec/logging_spec.rb
135
178
  - spec/retry_report_and_notify_success_spec.rb
136
179
  - spec/spec_helper.rb
137
- - bin/ey-enzyme
138
- - bin/ey-recipes
139
- has_rdoc: true
140
180
  homepage: http://github.com/engineyard/ey_enzyme
141
181
  licenses: []
142
182
 
@@ -150,17 +190,23 @@ required_ruby_version: !ruby/object:Gem::Requirement
150
190
  requirements:
151
191
  - - ">="
152
192
  - !ruby/object:Gem::Version
193
+ hash: 3
194
+ segments:
195
+ - 0
153
196
  version: "0"
154
197
  required_rubygems_version: !ruby/object:Gem::Requirement
155
198
  none: false
156
199
  requirements:
157
200
  - - ">="
158
201
  - !ruby/object:Gem::Version
202
+ hash: 3
203
+ segments:
204
+ - 0
159
205
  version: "0"
160
206
  requirements: []
161
207
 
162
208
  rubyforge_project:
163
- rubygems_version: 1.5.2
209
+ rubygems_version: 1.8.10
164
210
  signing_key:
165
211
  specification_version: 3
166
212
  summary: Gem for kicking off chef recipes