Merge "Refactor RAID configuration via iRMC driver"
This commit is contained in:
commit
01948beb7a
@ -21,8 +21,6 @@ import six
|
||||
|
||||
from ironic.common import exception
|
||||
from ironic.common.i18n import _
|
||||
from ironic.common import raid as raid_common
|
||||
from ironic.conductor import utils as manager_utils
|
||||
from ironic.conf import CONF
|
||||
|
||||
scci = importutils.try_import('scciclient.irmc.scci')
|
||||
@ -221,9 +219,3 @@ def set_secure_boot_mode(node, enable):
|
||||
raise exception.IRMCOperationError(
|
||||
operation=_("setting secure boot mode"),
|
||||
error=irmc_exception)
|
||||
|
||||
|
||||
def resume_cleaning(task):
|
||||
raid_common.update_raid_info(
|
||||
task.node, task.node.raid_config)
|
||||
manager_utils.notify_conductor_resume_clean(task)
|
||||
|
@ -25,6 +25,7 @@ from ironic.common import exception
|
||||
from ironic.common import raid as raid_common
|
||||
from ironic.common import states
|
||||
from ironic.conductor import task_manager
|
||||
from ironic.conductor import utils as manager_utils
|
||||
from ironic import conf
|
||||
from ironic.drivers import base
|
||||
from ironic.drivers.modules.irmc import common as irmc_common
|
||||
@ -478,11 +479,10 @@ class IRMCRAID(base.RAIDInterface):
|
||||
if all(fgi_status == 'Idle' for fgi_status in
|
||||
fgi_status_dict.values()):
|
||||
raid_config.update({'fgi_status': RAID_COMPLETED})
|
||||
raid_common.update_raid_info(node, raid_config)
|
||||
LOG.info('RAID configuration has completed on '
|
||||
'node %(node)s with fgi_status is %(fgi)s',
|
||||
{'node': node_uuid, 'fgi': RAID_COMPLETED})
|
||||
irmc_common.resume_cleaning(task)
|
||||
self._resume_cleaning(task)
|
||||
|
||||
except exception.NodeNotFound:
|
||||
LOG.info('During query_raid_config_job_status, node '
|
||||
@ -500,3 +500,7 @@ class IRMCRAID(base.RAIDInterface):
|
||||
fgi_message = 'ServerViewRAID not available in Baremetal Server'
|
||||
task.node.last_error = fgi_message
|
||||
task.process_event('fail')
|
||||
|
||||
def _resume_cleaning(self, task):
|
||||
raid_common.update_raid_info(task.node, task.node.raid_config)
|
||||
manager_utils.notify_conductor_resume_clean(task)
|
||||
|
@ -202,7 +202,7 @@ class iRMCPeriodicTaskTestCase(test_common.BaseIRMCTest):
|
||||
fgi_mock.assert_called_once_with(report_mock.return_value,
|
||||
self.node.uuid)
|
||||
|
||||
@mock.patch.object(irmc_common, 'resume_cleaning')
|
||||
@mock.patch('ironic.drivers.modules.irmc.raid.IRMCRAID._resume_cleaning')
|
||||
@mock.patch('ironic.drivers.modules.irmc.raid.IRMCRAID._set_clean_failed')
|
||||
@mock.patch('ironic.drivers.modules.irmc.raid._get_fgi_status')
|
||||
@mock.patch.object(irmc_common, 'get_irmc_report')
|
||||
@ -230,7 +230,7 @@ class iRMCPeriodicTaskTestCase(test_common.BaseIRMCTest):
|
||||
self.node.uuid)
|
||||
clean_mock.assert_called_once_with(task)
|
||||
|
||||
@mock.patch.object(irmc_common, 'resume_cleaning')
|
||||
@mock.patch('ironic.drivers.modules.irmc.raid.IRMCRAID._resume_cleaning')
|
||||
@mock.patch('ironic.drivers.modules.irmc.raid.IRMCRAID._set_clean_failed')
|
||||
@mock.patch('ironic.drivers.modules.irmc.raid._get_fgi_status')
|
||||
@mock.patch.object(irmc_common, 'get_irmc_report')
|
||||
@ -260,7 +260,7 @@ class iRMCPeriodicTaskTestCase(test_common.BaseIRMCTest):
|
||||
self.node.uuid)
|
||||
clean_mock.assert_called_once_with(task)
|
||||
|
||||
@mock.patch.object(irmc_common, 'resume_cleaning')
|
||||
@mock.patch('ironic.drivers.modules.irmc.raid.IRMCRAID._resume_cleaning')
|
||||
@mock.patch('ironic.drivers.modules.irmc.raid.IRMCRAID._set_clean_failed')
|
||||
@mock.patch('ironic.drivers.modules.irmc.raid._get_fgi_status')
|
||||
@mock.patch.object(irmc_common, 'get_irmc_report')
|
||||
|
Loading…
Reference in New Issue
Block a user