Software RAID: don't try to set local_gb to MAX
Change-Id: Ibac5d07b988438719bf414f314cbc610562e7599
This commit is contained in:
parent
5026854e31
commit
cedc4a2416
@ -114,6 +114,7 @@ def update_raid_info(node, raid_config):
|
||||
if root_logical_disk:
|
||||
# Update local_gb and root_device_hint
|
||||
properties = node.properties
|
||||
if root_logical_disk['size_gb'] != 'MAX':
|
||||
properties['local_gb'] = root_logical_disk['size_gb']
|
||||
try:
|
||||
properties['root_device'] = (
|
||||
|
@ -212,7 +212,8 @@ class RaidPublicMethodsTestCase(db_base.DbTestCase):
|
||||
self.assertIn('foo', logical_disk_properties)
|
||||
|
||||
def _test_update_raid_info(self, current_config,
|
||||
capabilities=None):
|
||||
capabilities=None,
|
||||
skip_local_gb=False):
|
||||
node = self.node
|
||||
if capabilities:
|
||||
properties = node.properties
|
||||
@ -231,6 +232,9 @@ class RaidPublicMethodsTestCase(db_base.DbTestCase):
|
||||
if current_config['logical_disks'][0].get('is_root_volume'):
|
||||
self.assertEqual({'wwn': '600508B100'},
|
||||
properties['root_device'])
|
||||
if skip_local_gb:
|
||||
self.assertNotIn('local_gb', properties)
|
||||
else:
|
||||
self.assertEqual(100, properties['local_gb'])
|
||||
self.assertIn('raid_level:1', properties['capabilities'])
|
||||
if capabilities:
|
||||
@ -267,6 +271,13 @@ class RaidPublicMethodsTestCase(db_base.DbTestCase):
|
||||
self._test_update_raid_info,
|
||||
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):
|
||||
result = raid.filter_target_raid_config(self.node)
|
||||
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