ironfan 4.9.8 → 4.9.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/CHANGELOG.md +3 -0
  2. data/VERSION +1 -1
  3. data/ironfan.gemspec +2 -2
  4. data/lib/ironfan.rb +8 -8
  5. metadata +3 -3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # v4.9.9
2
+ * further fixes to tell_you_thrice, noted need for specs
3
+
1
4
  # v4.9.8
2
5
  * fixing rescue block in tell_you_thrice
3
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.9.8
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"
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-17"
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 if try > retries
160
- try += 1
161
- pause_for = multiplier * try
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.8
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-17 00:00:00.000000000 Z
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: 743785728479819122
362
+ hash: 1492496330454923424
363
363
  required_rubygems_version: !ruby/object:Gem::Requirement
364
364
  none: false
365
365
  requirements: