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