Ensure storage hooks observe disable-ring-rebalance
When adding new storage capacity, its desirable to disable ring rebalancing until all new storage has been added, allowing the end-user to determing when all new capacity has been added and its OK to rebalance the rings and re-distribute. Ensure that storage hook events from swift-storage observe the 'disable-ring-rebalance' configuration option, enabling end users to perform this type of orchestration storage expansion. Change-Id: I95727e663b369d5feb28147b19edcc6cab36b905 Closes-Bug: 1638981
This commit is contained in:
@@ -90,6 +90,13 @@ class SwiftUtilsTestCase(unittest.TestCase):
|
||||
self.assertTrue(mock_set_min_hours.called)
|
||||
self.assertTrue(mock_balance_rings.called)
|
||||
|
||||
mock_balance_rings.reset_mock()
|
||||
swift_utils.update_rings(min_part_hours=10,
|
||||
rebalance=False)
|
||||
self.assertTrue(mock_get_min_hours.called)
|
||||
self.assertTrue(mock_set_min_hours.called)
|
||||
self.assertFalse(mock_balance_rings.called)
|
||||
|
||||
@mock.patch('lib.swift_utils.previously_synced')
|
||||
@mock.patch('lib.swift_utils._load_builder')
|
||||
@mock.patch('lib.swift_utils.initialize_ring')
|
||||
|
||||
Reference in New Issue
Block a user