

def read_attachment(self, attachment_id='', include_content=False):
    '\n        Returns the metadata of an attachment. Unless indicated otherwise the content returned\n        is only a name to the actual attachment content.\n        '
    attachment = self.read(attachment_id)
    if (not isinstance(attachment, Attachment)):
        raise Inconsistent(('Object in datastore must be Attachment, not %s' % type(attachment)))
    if include_content:
        attachment.content = attachment.rr_store.read_attachment(attachment_id, attachment_name=self.DEFAULT_ATTACHMENT_NAME)
        if (attachment.attachment_type == AttachmentType.BLOB):
            if (type(attachment.content) is not str):
                raise BadRequest('Attachment content must be str')
    return attachment

dataset/ETHPy150Open ooici/pyon/pyon/ion/resregistry.py ResourceRegistry.read_attachment/VarMisuse@65/151 `self`->`attachment`