def _get_boot_device(node, drac_boot_devices=None):
    client = drac_common.get_drac_client(node)

    try:
        boot_modes = client.list_boot_modes()
        next_boot_modes = [mode.id for mode in boot_modes if mode.is_next]
        if NON_PERSISTENT_BOOT_MODE in next_boot_modes:
            next_boot_mode = NON_PERSISTENT_BOOT_MODE
        else:
            next_boot_mode = next_boot_modes[0]

        if drac_boot_devices is None:
            drac_boot_devices = client.list_boot_devices()
        drac_boot_device = drac_boot_devices[next_boot_mode][0]

        boot_device = next(key for (key, value) in _BOOT_DEVICES_MAP.items()
                           if drac_boot_device.id in value)
        return {'boot_device': boot_device,
                'persistent': next_boot_mode == PERSISTENT_BOOT_MODE}
    except (drac_exceptions.BaseClientException, IndexError) as exc:
        LOG.error(_LE('DRAC driver failed to get next boot mode for '
                      'node %(node_uuid)s. Reason: %(error)s.'),
                  {'node_uuid': node.uuid, 'error': exc})
        raise exception.DracOperationError(error=exc)
dataset/ETHPy150Open openstack/ironic/ironic/drivers/modules/drac/management.py/_get_boot_device/swapped operands of `in`