def _parse_raw_bytes(raw_bytes):
    """Parse raw bytes string.

    :param raw_bytes: a string of hexadecimal raw bytes, e.g. '0x00 0x01'.
    :returns: a tuple containing the arguments for pyghmi call as integers,
             (IPMI net function, IPMI command, list of command's data).
    :raises: InvalidParameterValue when an invalid value is specified.
    """
    try:
        bytes_list = [int(x, base=16) for x in raw_bytes.split()]
        return bytes_list[0], bytes_list[1], bytes_list[2:]
    except ValueError:
        raise exception.InvalidParameterValue(_(
            "Invalid raw bytes string: '%s'") % raw_bytes)
    except __HOLE__:
        raise exception.InvalidParameterValue(_(
            "Raw bytes string requires two bytes at least."))
dataset/ETHPy150Open openstack/ironic/ironic/drivers/modules/ipminative.py/_parse_raw_bytes