summaryrefslogtreecommitdiff
path: root/swift/cli/ringbuilder.py
diff options
context:
space:
mode:
Diffstat (limited to 'swift/cli/ringbuilder.py')
-rwxr-xr-xswift/cli/ringbuilder.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/swift/cli/ringbuilder.py b/swift/cli/ringbuilder.py
index eac586e26..d9c774a42 100755
--- a/swift/cli/ringbuilder.py
+++ b/swift/cli/ringbuilder.py
@@ -859,7 +859,7 @@ swift-ring-builder <builder_file> rebalance [options]
devs_changed = builder.devs_changed
try:
last_balance = builder.get_balance()
- parts, balance = builder.rebalance(seed=get_seed(3))
+ parts, balance, removed_devs = builder.rebalance(seed=get_seed(3))
except exceptions.RingBuilderError as e:
print '-' * 79
print("An error has occurred during ring validation. Common\n"
@@ -869,10 +869,10 @@ swift-ring-builder <builder_file> rebalance [options]
(e,))
print '-' * 79
exit(EXIT_ERROR)
- if not (parts or options.force):
- print 'No partitions could be reassigned.'
- print 'Either none need to be or none can be due to ' \
- 'min_part_hours [%s].' % builder.min_part_hours
+ if not (parts or options.force or removed_devs):
+ print('No partitions could be reassigned.')
+ print('Either none need to be or none can be due to '
+ 'min_part_hours [%s].' % builder.min_part_hours)
exit(EXIT_WARNING)
# If we set device's weight to zero, currently balance will be set
# special value(MAX_BALANCE) until zero weighted device return all