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:
James Page
2017-02-02 10:58:20 +00:00
parent 08f81f6a0e
commit 1cf5ea71d0
3 changed files with 16 additions and 4 deletions

View File

@@ -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')