raid.py (ironic-17.0.2) | : | raid.py (ironic-17.0.3) | ||
---|---|---|---|---|
skipping to change at line 38 | skipping to change at line 38 | |||
from ironic.common import exception | from ironic.common import exception | |||
from ironic.common.i18n import _ | from ironic.common.i18n import _ | |||
from ironic.common import raid as raid_common | from ironic.common import raid as raid_common | |||
from ironic.conductor import task_manager | from ironic.conductor import task_manager | |||
from ironic.conductor import utils as manager_utils | from ironic.conductor import utils as manager_utils | |||
from ironic.conf import CONF | from ironic.conf import CONF | |||
from ironic.drivers import base | from ironic.drivers import base | |||
from ironic.drivers.modules import deploy_utils | from ironic.drivers.modules import deploy_utils | |||
from ironic.drivers.modules.drac import common as drac_common | 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 job as drac_job | |||
from ironic.drivers.modules.drac import utils as drac_utils | ||||
from ironic.drivers.modules.redfish import raid as redfish_raid | from ironic.drivers.modules.redfish import raid as redfish_raid | |||
from ironic.drivers.modules.redfish import utils as redfish_utils | ||||
drac_exceptions = importutils.try_import('dracclient.exceptions') | drac_exceptions = importutils.try_import('dracclient.exceptions') | |||
drac_constants = importutils.try_import('dracclient.constants') | drac_constants = importutils.try_import('dracclient.constants') | |||
sushy = importutils.try_import('sushy') | sushy = importutils.try_import('sushy') | |||
LOG = logging.getLogger(__name__) | LOG = logging.getLogger(__name__) | |||
METRICS = metrics_utils.get_metrics_logger(__name__) | METRICS = metrics_utils.get_metrics_logger(__name__) | |||
_CURRENT_RAID_CONTROLLER_MODE = "RAIDCurrentControllerMode" | _CURRENT_RAID_CONTROLLER_MODE = "RAIDCurrentControllerMode" | |||
skipping to change at line 1175 | skipping to change at line 1175 | |||
def _is_realtime_ready(task): | def _is_realtime_ready(task): | |||
"""Gets is real time ready status | """Gets is real time ready status | |||
Uses sushy-oem-idrac extension. | Uses sushy-oem-idrac extension. | |||
:param task: TaskManager object containing the node. | :param task: TaskManager object containing the node. | |||
:returns: True, if real time operations are ready, otherwise False. | :returns: True, if real time operations are ready, otherwise False. | |||
:raises RedfishError: If can't find OEM extension or it fails to | :raises RedfishError: If can't find OEM extension or it fails to | |||
execute | execute | |||
""" | """ | |||
system = redfish_utils.get_system(task.node) | return drac_utils.execute_oem_manager_method( | |||
for manager in system.managers: | task, 'get real-time ready status', | |||
try: | lambda m: m.lifecycle_service.is_realtime_ready()) | |||
manager_oem = manager.get_oem_extension('Dell') | ||||
except sushy.exceptions.OEMExtensionNotFoundError as e: | ||||
error_msg = (_("Search for Sushy OEM extension Python package " | ||||
"'sushy-oem-idrac' failed for node %(node)s. " | ||||
"Ensure it is installed. Error: %(error)s") % | ||||
{'node': task.node.uuid, 'error': e}) | ||||
LOG.error(error_msg) | ||||
raise exception.RedfishError(error=error_msg) | ||||
try: | ||||
return manager_oem.lifecycle_service.is_realtime_ready() | ||||
except sushy.exceptions.SushyError as e: | ||||
LOG.debug("Failed to get real time ready status with system " | ||||
"%(system)s manager %(manager)s for node %(node)s. Will " | ||||
"try next manager, if available. Error: %(error)s", | ||||
{'system': system.uuid if system.uuid else | ||||
system.identity, | ||||
'manager': manager.uuid if manager.uuid else | ||||
manager.identity, | ||||
'node': task.node.uuid, | ||||
'error': e}) | ||||
continue | ||||
break | ||||
else: | ||||
error_msg = (_("iDRAC Redfish get real time ready status failed for " | ||||
"node %(node)s, because system %(system)s has no " | ||||
"manager%(no_manager)s.") % | ||||
{'node': task.node.uuid, | ||||
'system': system.uuid if system.uuid else | ||||
system.identity, | ||||
'no_manager': '' if not system.managers else | ||||
' which could'}) | ||||
LOG.error(error_msg) | ||||
raise exception.RedfishError(error=error_msg) | ||||
class DracRedfishRAID(redfish_raid.RedfishRAID): | class DracRedfishRAID(redfish_raid.RedfishRAID): | |||
"""iDRAC Redfish interface for RAID related actions. | """iDRAC Redfish interface for RAID related actions. | |||
Includes iDRAC specific adjustments for RAID related actions. | Includes iDRAC specific adjustments for RAID related actions. | |||
""" | """ | |||
@base.clean_step(priority=0, abortable=False, argsinfo={ | @base.clean_step(priority=0, abortable=False, argsinfo={ | |||
'create_root_volume': { | 'create_root_volume': { | |||
'description': ( | 'description': ( | |||
End of changes. 3 change blocks. | ||||
39 lines changed or deleted | 4 lines changed or added |