@common.node_has_server_profile
def get_boot_device(self, task):
    "Get the current boot device for the task's node.\n\n        Provides the current boot device of the node.\n\n        :param task: a task from TaskManager.\n        :returns: a dictionary containing:\n            :boot_device: the boot device, one of\n                :mod:`ironic.common.boot_devices` [PXE, DISK, CDROM]\n            :persistent: Whether the boot device will persist to all\n                future boots or not, None if it is unknown.\n        :raises: OperationNotPermitted if no Server Profile is associated with\n        the node\n        :raises: InvalidParameterValue if the boot device is unknown\n        :raises: OneViewError if the communication with OneView fails\n        "
    oneview_info = common.get_oneview_info(task.node)
    try:
        oneview_client = common.get_oneview_client()
        boot_order = oneview_client.get_boot_order(oneview_info)
    except oneview_exceptions.OneViewException as oneview_exc:
        msg = (_('Error getting boot device from OneView. Error: %s') % oneview_exc)
        LOG.error(msg)
        raise exception.OneViewError(msg)
    primary_device = boot_order[0]
    if (primary_device not in BOOT_DEVICE_OV_TO_GENERIC):
        raise exception.InvalidParameterValue((_('Unsupported boot Device %(device)s for Node: %(node)s') % {'device': primary_device, 'node': task.node.uuid}))
    boot_device = {'boot_device': BOOT_DEVICE_OV_TO_GENERIC.get(primary_device), 'persistent': True}
    return boot_device
Get the current boot device for the task's node.

Provides the current boot device of the node.

:param task: a task from TaskManager.
:returns: a dictionary containing:
    :boot_device: the boot device, one of
        :mod:`ironic.common.boot_devices` [PXE, DISK, CDROM]
    :persistent: Whether the boot device will persist to all
        future boots or not, None if it is unknown.
:raises: OperationNotPermitted if no Server Profile is associated with
the node
:raises: InvalidParameterValue if the boot device is unknown
:raises: OneViewError if the communication with OneView fails
@common.node_has_server_profile
def get_boot_device(self, task):
    "Get the current boot device for the task's node.\n\n        Provides the current boot device of the node.\n\n        :param task: a task from TaskManager.\n        :returns: a dictionary containing:\n            :boot_device: the boot device, one of\n                :mod:`ironic.common.boot_devices` [PXE, DISK, CDROM]\n            :persistent: Whether the boot device will persist to all\n                future boots or not, None if it is unknown.\n        :raises: OperationNotPermitted if no Server Profile is associated with\n        the node\n        :raises: InvalidParameterValue if the boot device is unknown\n        :raises: OneViewError if the communication with OneView fails\n        "
    oneview_info = common.get_oneview_info(task.node)
    try:
        oneview_client = common.get_oneview_client()
        boot_order = oneview_client.get_boot_order(oneview_info)
    except oneview_exceptions.OneViewException as oneview_exc:
        msg = (_('Error getting boot device from OneView. Error: %s') % oneview_exc)
        LOG.error(msg)
        raise exception.OneViewError(msg)
    primary_device = boot_order[0]
    if (primary_device not in BOOT_DEVICE_OV_TO_GENERIC):
        raise exception.InvalidParameterValue((_('Unsupported boot Device %(device)s for Node: %(node)s') % {'device': primary_device, 'node': task.node.uuid}))
    boot_device = {'boot_device': BOOT_DEVICE_OV_TO_GENERIC.get(primary_device), 'persistent': True}
    return boot_device