Treat add/remove/rebalance during part-power increase as error
We weren't actually willing to change anything; sure sounds like an error to me. Change-Id: I033f6fba4ddb3dd502dfd5393dd2e9a2115672e0
This commit is contained in:
parent
9eb81f6e69
commit
770cc287aa
@ -777,7 +777,7 @@ swift-ring-builder <builder_file> add
|
||||
if builder.next_part_power:
|
||||
print('Partition power increase in progress. You need ')
|
||||
print('to finish the increase first before adding devices.')
|
||||
exit(EXIT_WARNING)
|
||||
exit(EXIT_ERROR)
|
||||
|
||||
try:
|
||||
for new_dev in _parse_add_values(argv[3:]):
|
||||
@ -996,7 +996,7 @@ swift-ring-builder <builder_file> remove
|
||||
if builder.next_part_power:
|
||||
print('Partition power increase in progress. You need ')
|
||||
print('to finish the increase first before removing devices.')
|
||||
exit(EXIT_WARNING)
|
||||
exit(EXIT_ERROR)
|
||||
|
||||
devs, opts = _parse_remove_values(argv[3:])
|
||||
|
||||
@ -1063,7 +1063,7 @@ swift-ring-builder <builder_file> rebalance [options]
|
||||
if builder.next_part_power:
|
||||
print('Partition power increase in progress.')
|
||||
print('You need to finish the increase first before rebalancing.')
|
||||
exit(EXIT_WARNING)
|
||||
exit(EXIT_ERROR)
|
||||
|
||||
devs_changed = builder.devs_changed
|
||||
min_part_seconds_left = builder.min_part_seconds_left
|
||||
|
@ -535,7 +535,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
||||
|
||||
argv = ["", self.tmpfile, "add",
|
||||
"r0z0-127.0.1.1:6200/sda1_some meta data", "100"]
|
||||
self.assertSystemExit(EXIT_WARNING, ringbuilder.main, argv)
|
||||
self.assertSystemExit(EXIT_ERROR, ringbuilder.main, argv)
|
||||
|
||||
def test_remove_device(self):
|
||||
for search_value in self.search_values:
|
||||
@ -817,7 +817,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
||||
ring.save(self.tmpfile)
|
||||
|
||||
argv = ["", self.tmpfile, "remove", "d0"]
|
||||
self.assertSystemExit(EXIT_WARNING, ringbuilder.main, argv)
|
||||
self.assertSystemExit(EXIT_ERROR, ringbuilder.main, argv)
|
||||
|
||||
def test_set_weight(self):
|
||||
for search_value in self.search_values:
|
||||
@ -2536,7 +2536,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
||||
ring.save(self.tmpfile)
|
||||
|
||||
argv = ["", self.tmpfile, "rebalance", "3"]
|
||||
self.assertSystemExit(EXIT_WARNING, ringbuilder.main, argv)
|
||||
self.assertSystemExit(EXIT_ERROR, ringbuilder.main, argv)
|
||||
|
||||
def test_write_ring(self):
|
||||
self.create_sample_ring()
|
||||
|
Loading…
Reference in New Issue
Block a user