Software RAID: don't try to set local_gb to MAX
Change-Id: Ibac5d07b988438719bf414f314cbc610562e7599
This commit is contained in:
parent
5026854e31
commit
cedc4a2416
@ -114,7 +114,8 @@ def update_raid_info(node, raid_config):
|
|||||||
if root_logical_disk:
|
if root_logical_disk:
|
||||||
# Update local_gb and root_device_hint
|
# Update local_gb and root_device_hint
|
||||||
properties = node.properties
|
properties = node.properties
|
||||||
properties['local_gb'] = root_logical_disk['size_gb']
|
if root_logical_disk['size_gb'] != 'MAX':
|
||||||
|
properties['local_gb'] = root_logical_disk['size_gb']
|
||||||
try:
|
try:
|
||||||
properties['root_device'] = (
|
properties['root_device'] = (
|
||||||
root_logical_disk['root_device_hint'])
|
root_logical_disk['root_device_hint'])
|
||||||
|
@ -212,7 +212,8 @@ class RaidPublicMethodsTestCase(db_base.DbTestCase):
|
|||||||
self.assertIn('foo', logical_disk_properties)
|
self.assertIn('foo', logical_disk_properties)
|
||||||
|
|
||||||
def _test_update_raid_info(self, current_config,
|
def _test_update_raid_info(self, current_config,
|
||||||
capabilities=None):
|
capabilities=None,
|
||||||
|
skip_local_gb=False):
|
||||||
node = self.node
|
node = self.node
|
||||||
if capabilities:
|
if capabilities:
|
||||||
properties = node.properties
|
properties = node.properties
|
||||||
@ -231,7 +232,10 @@ class RaidPublicMethodsTestCase(db_base.DbTestCase):
|
|||||||
if current_config['logical_disks'][0].get('is_root_volume'):
|
if current_config['logical_disks'][0].get('is_root_volume'):
|
||||||
self.assertEqual({'wwn': '600508B100'},
|
self.assertEqual({'wwn': '600508B100'},
|
||||||
properties['root_device'])
|
properties['root_device'])
|
||||||
self.assertEqual(100, properties['local_gb'])
|
if skip_local_gb:
|
||||||
|
self.assertNotIn('local_gb', properties)
|
||||||
|
else:
|
||||||
|
self.assertEqual(100, properties['local_gb'])
|
||||||
self.assertIn('raid_level:1', properties['capabilities'])
|
self.assertIn('raid_level:1', properties['capabilities'])
|
||||||
if capabilities:
|
if capabilities:
|
||||||
self.assertIn(capabilities, properties['capabilities'])
|
self.assertIn(capabilities, properties['capabilities'])
|
||||||
@ -267,6 +271,13 @@ class RaidPublicMethodsTestCase(db_base.DbTestCase):
|
|||||||
self._test_update_raid_info,
|
self._test_update_raid_info,
|
||||||
current_config)
|
current_config)
|
||||||
|
|
||||||
|
def test_update_raid_info_skip_MAX(self):
|
||||||
|
current_config = json.loads(raid_constants.CURRENT_RAID_CONFIG)
|
||||||
|
current_config['logical_disks'][0]['size_gb'] = 'MAX'
|
||||||
|
self._test_update_raid_info(current_config,
|
||||||
|
capabilities='boot_mode:bios',
|
||||||
|
skip_local_gb=True)
|
||||||
|
|
||||||
def test_filter_target_raid_config(self):
|
def test_filter_target_raid_config(self):
|
||||||
result = raid.filter_target_raid_config(self.node)
|
result = raid.filter_target_raid_config(self.node)
|
||||||
self.assertEqual(self.node.target_raid_config, result)
|
self.assertEqual(self.node.target_raid_config, result)
|
||||||
|
5
releasenotes/notes/raid-max-c0920cc44b9779ee.yaml
Normal file
5
releasenotes/notes/raid-max-c0920cc44b9779ee.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
No longer tries to set ``local_gb`` to ``MAX`` when building RAID with
|
||||||
|
the root disk using ``MAX`` for its size.
|
Loading…
Reference in New Issue
Block a user