Skip to content

Commit

Permalink
Merge pull request #132 from Tumblr/upgrade_plugin_fix_spare_ask
Browse files Browse the repository at this point in the history
fix the upgrade helper spare ask
  • Loading branch information
Bob Patterson Jr committed Jun 9, 2015
2 parents d67f7dd + 963105b commit c200965
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/upgrade_helper/commandsuite.rb
Expand Up @@ -17,8 +17,8 @@ def upgrade_clone_slave

puts "You may clone to particular IP address(es), or can type \"spare\" to claim a node from the spare pool."
target = options[:target] || ask('Please enter comma-separated list of targets (IPs or "spare") to clone to: ')
spares_needed = target.split(',').count {|t| t.strip.upcase == 'SPARE'}
target = 'spare' if target.strip == '' || target.split(',').length == 0
spares_needed = target.split(',').count {|t| t.strip.upcase == 'SPARE'}
if spares_needed > 0
spares_available = Jetpants.topology.count_spares(role: :standby_slave, like: source, version: Plugin::UpgradeHelper.new_version)
raise "Not enough upgraded spares with role of standby slave! Requested #{spares_needed} but only have #{spares_available} available." if spares_needed > spares_available
Expand Down

0 comments on commit c200965

Please sign in to comment.