"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ironic/drivers/modules/drac/boot.py" between
ironic-17.0.2.tar.gz and ironic-17.0.3.tar.gz

About: OpenStack Ironic (Optional Service: Bare-Metal Provisioning) aims to provision bare metal machines instead of virtual machines, forked from the Nova baremetal driver.
The "Wallaby" series (latest release).

boot.py  (ironic-17.0.2):boot.py  (ironic-17.0.3)
# Copyright 2019 Red Hat, Inc. # Copyright 2019 Red Hat, Inc.
# All Rights Reserved. # All Rights Reserved.
# Copyright (c) 2019 Dell Inc. or its subsidiaries. # Copyright (c) 2019-2021 Dell Inc. or its subsidiaries.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain # not use this file except in compliance with the License. You may obtain
# a copy of the License at # a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo_log import log from oslo_log import log
from oslo_utils import importutils from oslo_utils import importutils
from ironic.common import boot_devices from ironic.common import boot_devices
from ironic.common import exception from ironic.drivers.modules.drac import utils as drac_utils
from ironic.common.i18n import _
from ironic.drivers.modules.redfish import boot as redfish_boot from ironic.drivers.modules.redfish import boot as redfish_boot
from ironic.drivers.modules.redfish import utils as redfish_utils from ironic.drivers.modules.redfish import utils as redfish_utils
LOG = log.getLogger(__name__) LOG = log.getLogger(__name__)
sushy = importutils.try_import('sushy') sushy = importutils.try_import('sushy')
class DracRedfishVirtualMediaBoot(redfish_boot.RedfishVirtualMediaBoot): class DracRedfishVirtualMediaBoot(redfish_boot.RedfishVirtualMediaBoot):
"""iDRAC Redfish interface for virtual media boot-related actions. """iDRAC Redfish interface for virtual media boot-related actions.
skipping to change at line 107 skipping to change at line 106
'media device for node %(node)s', 'media device for node %(node)s',
{'device': device, 'node': task.node.uuid}) {'device': device, 'node': task.node.uuid})
super(DracRedfishVirtualMediaBoot, cls)._set_boot_device( super(DracRedfishVirtualMediaBoot, cls)._set_boot_device(
task, device, persistent) task, device, persistent)
return return
device = cls.VIRTUAL_MEDIA_DEVICES[device] device = cls.VIRTUAL_MEDIA_DEVICES[device]
system = redfish_utils.get_system(task.node) system = redfish_utils.get_system(task.node)
for manager in system.managers: drac_utils.execute_oem_manager_method(
task, 'set virtual boot device',
# This call makes Sushy go fishing in the ocean of Sushy lambda m, manager: m.set_virtual_boot_device(
# OEM extensions installed on the system. If it finds one device, persistent=persistent, system=system,
# for 'Dell' which implements the 'Manager' resource manager=manager), pass_manager=True)
# extension, it uses it to create an object which
# instantiates itself from the OEM JSON. The object is
# returned here.
#
# If the extension could not be found for one manager, it
# will not be found for any others until it is installed, so
# abruptly exit the for loop. The vendor and resource name,
# 'Dell' and 'Manager', respectively, used to search for the
# extension are invariant in the loop.
try:
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:
manager_oem.set_virtual_boot_device(
device, persistent=persistent, manager=manager,
system=system)
except sushy.exceptions.SushyError as e:
LOG.debug("Sushy OEM extension Python package "
"'sushy-oem-idrac' failed to set virtual boot "
"device 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
LOG.info("Set node %(node)s boot device to %(device)s via OEM",
{'node': task.node.uuid, 'device': device})
break
else:
error_msg = (_('iDRAC Redfish set boot device 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)
 End of changes. 3 change blocks. 
3 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)