'Add to registry\'s information about image membership.'

def add_member(self, image_id, member_id, can_share=None):

    body = None
    headers = {}
    if (can_share is not None):
        body = jsonutils.dump_as_bytes(dict(member=dict(can_share=can_share)))
        headers['Content-Type'] = 'application/json'
    url = ('/images/%s/members/%s' % (image_id, member_id))
    res = self.do_request('PUT', url, body=body, headers=headers)
    return (self.get_status_code(res) == 204)
