'Ensures that all required image metadata values are valid.'

def _validate_image_for_activation(self, req, id, values):

    image = self.get_image_meta_or_404(req, id)
    if (values['disk_format'] is None):
        if (not image['disk_format']):
            msg = _('Disk    format    is    not    specified.')
            raise HTTPBadRequest(explanation=msg, request=req)
        values['disk_format'] = image['disk_format']
    if (values['container_format'] is None):
        if (not image['container_format']):
            msg = _('Container    format    is    not    specified.')
            raise HTTPBadRequest(explanation=msg, request=req)
        values['container_format'] = image['container_format']
    if ('name' not in values):
        values['name'] = image['name']
    values = validate_image_meta(req, values)
    return values
