ironfan 4.9.8 → 4.9.9
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.
- data/CHANGELOG.md +3 -0
- data/VERSION +1 -1
- data/ironfan.gemspec +2 -2
- data/lib/ironfan.rb +8 -8
- metadata +3 -3
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.9.
|
1
|
+
4.9.9
|
data/ironfan.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "ironfan"
|
8
|
-
s.version = "4.9.
|
8
|
+
s.version = "4.9.9"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Infochimps"]
|
12
|
-
s.date = "2013-04-
|
12
|
+
s.date = "2013-04-18"
|
13
13
|
s.description = "Ironfan allows you to orchestrate not just systems but clusters of machines. It includes a powerful layer on top of knife and a collection of cloud cookbooks."
|
14
14
|
s.email = "coders@infochimps.com"
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/ironfan.rb
CHANGED
@@ -144,9 +144,12 @@ module Ironfan
|
|
144
144
|
#
|
145
145
|
# Utility to retry a flaky operation three times, with ascending wait times
|
146
146
|
#
|
147
|
+
# FIXME: Add specs to test the rescue here. It's a PITA to debug naturally or
|
148
|
+
#
|
149
|
+
# Manual test:
|
150
|
+
# bundle exec ruby -e "require 'chef'; require 'ironfan'; Ironfan.tell_you_thrice { p 'hah'; raise 'hell' }"
|
147
151
|
def self.tell_you_thrice(options={})
|
148
152
|
options = { name: "problem",
|
149
|
-
problem: nil,
|
150
153
|
error_class: StandardError,
|
151
154
|
retries: 3,
|
152
155
|
multiplier: 3 }.merge!(options)
|
@@ -154,15 +157,12 @@ module Ironfan
|
|
154
157
|
message = ''
|
155
158
|
|
156
159
|
begin
|
160
|
+
try += 1
|
157
161
|
yield
|
158
162
|
rescue options[:error_class] => err
|
159
|
-
raise
|
160
|
-
|
161
|
-
|
162
|
-
message += "#{problem}, " unless problem.nil?
|
163
|
-
message += "sleeping #{pause_for} seconds"
|
164
|
-
Ironfan.step(name, message, :gray)
|
165
|
-
Chef::Log.debug "Error was #{err.inspect}"
|
163
|
+
raise unless try < options[:retries]
|
164
|
+
pause_for = options[:multiplier] * try
|
165
|
+
Chef::Log.debug "Caught error (was #{err.inspect}). Sleeping #{pause_for} seconds."
|
166
166
|
sleep pause_for
|
167
167
|
retry
|
168
168
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ironfan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.9.
|
4
|
+
version: 4.9.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chef
|
@@ -359,7 +359,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
359
359
|
version: '0'
|
360
360
|
segments:
|
361
361
|
- 0
|
362
|
-
hash:
|
362
|
+
hash: 1492496330454923424
|
363
363
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
364
364
|
none: false
|
365
365
|
requirements:
|