'Basic data format validations.'

def _validate(self, bdm_dict):

    dict_fields = set((key for (key, _) in bdm_dict.items()))
    if (not (dict_fields <= (self._fields | self._db_only_fields))):
        raise exception.InvalidBDMFormat(details=_('Some    fields    are    invalid.'))
    if bdm_dict.get('no_device'):
        return
    if (self._required_fields and (not ((dict_fields & self._required_fields) == self._required_fields))):
        raise exception.InvalidBDMFormat(details=_('Some    required    fields    are    missing'))
    if ('delete_on_termination' in bdm_dict):
        bdm_dict['delete_on_termination'] = strutils.bool_from_string(bdm_dict['delete_on_termination'])
    if (bdm_dict.get('device_name') is not None):
        validate_device_name(bdm_dict['device_name'])
    validate_and_default_volume_size(bdm_dict)
    if bdm_dict.get('boot_index'):
        try:
            bdm_dict['boot_index'] = int(bdm_dict['boot_index'])
        except ValueError:
            raise exception.InvalidBDMFormat(details=_('Boot    index    is    invalid.'))
