3 ms·
> It should be prefetch_all_keys=False. It does not prefetch any key (maxkeys is set to 0), it performs a query on the bucket to validate that the bucket exis
by masklinn 13y ago
> It should be prefetch_all_keys=False.
It does not prefetch any key (maxkeys is set to 0), it performs a query on the bucket to validate that the bucket exists and blow up if the bucket does not exist. With validate=False, you can call get_bucket and get a bucket object where no remote bucket exists.
- sltkr 13y agoIt sounds like an annoying limitation of the API that (apparently?) you can't cheaply validate whether a bucket exists. Two manual work-arounds that come to mind: - store a list of created buckets as keys in another bucket. - store a dummy file in each bucket you create. Either method allows you to check the existence of the bucket with a GET request rather than a more expensive LIST request, but both are hackish. It seems like this is functionality S3 should already provide cheaply.
- masklinn 13y ago> It sounds like an annoying limitation of the API that (apparently?) you can't cheaply validate whether a bucket exists. It looks like there now is: http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketHEAD.html http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketHEA... I'm guessing (hoping?) that didn't exist back when the feature was added to Boto, 7 years ago: https://github.com/boto/boto/commit/8410c365ee0120e073bf00bdc9b913a0575d54f7 https://github.com/boto/boto/commit/8410c365ee0120e073bf00bd...