def get_key(bucket, obj):

    key = bucket.get_key(obj)
    if not key or not key.exists():
        msg = (_("Could not find key %(obj)s in bucket %(bucket)s") %
               {'obj': obj, 'bucket': bucket})
        LOG.debug(msg)
        raise exceptions.NotFound(message=msg)
    return key
Get a key from a bucket
dataset/ETHPy150Open openstack/glance_store/glance_store/_drivers/s3.py/get_key