Fix idrac-wsman RAID apply_configuration

Deploy step `apply_configuration` was failing with
TypeError: super(type, obj): obj must be an instance
or subtype of type.

Change-Id: I4de034c38585275543ab603a3ed45de1adf1d15b
Story: 2007963
Task: 40456
This commit is contained in:
Aija Jauntēva 2020-07-29 12:00:54 -04:00
parent ebae6a40f1
commit 328cb9291a
3 changed files with 22 additions and 1 deletions

View File

@ -1171,7 +1171,7 @@ class DracWSManRAID(base.RAIDInterface):
def apply_configuration(self, task, raid_config, create_root_volume=True,
create_nonroot_volumes=False,
delete_existing=True):
return super(DracRAID, self).apply_configuration(
return super(DracWSManRAID, self).apply_configuration(
task, raid_config, create_root_volume=create_root_volume,
create_nonroot_volumes=create_nonroot_volumes,
delete_existing=delete_existing)

View File

@ -24,6 +24,7 @@ from dracclient import exceptions as drac_exceptions
from ironic.common import exception
from ironic.common import states
from ironic.conductor import task_manager
from ironic.drivers import base
from ironic.drivers.modules.drac import common as drac_common
from ironic.drivers.modules.drac import job as drac_job
from ironic.drivers.modules.drac import raid as drac_raid
@ -2224,3 +2225,17 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest):
mock_commit_config.assert_called_once_with(
self.node, raid_controller='RAID.Integrated.1-1', reboot=False,
realtime=True)
@mock.patch.object(base.RAIDInterface, 'apply_configuration',
autospec=True)
def test_apply_configuration(self, mock_apply_configuration):
with task_manager.acquire(self.context, self.node.uuid,
shared=False) as task:
task.driver.raid.apply_configuration(
task, self.target_raid_configuration,
create_root_volume=False, create_nonroot_volumes=True,
delete_existing=False)
mock_apply_configuration.assert_called_once_with(
task.driver.raid, task,
self.target_raid_configuration, False, True, False)

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Fixes RAID ``apply_configuration`` deploy step for ``idrac-wsman`` where
deployment failed with ``TypeError``.
See `story 2007963 <https://storyboard.openstack.org/#!/story/2007963>`_.