I'm using S3 libcloud and when I retrieve a file, I am not provided with the metadata, nor does it provide the etag, last-modified date or the content-type.

I checked the headers returned from the Amazon S3 query and these fields are all present as follows: {'content-length': '11612', 'x-amz-id-2': 'rqpGyzJ5tq3x0jzyXrNjNQ9qQc14mGWX4kDridXS26jtGY62GTtj0XiHjflaNgOk', 'accept-ranges': 'bytes', 'server': 'AmazonS3', 'last-modified': 'Thu, 13 Sep 2012 07:13:22 GMT', 'etag': '"448fd165349e7b1a07c935b6ee69e3db"', 'x-amz-request-id': '2A32A41463F2D8FF', 'date': 'Thu, 13 Sep 2012 08:14:42 GMT', 'x-amz- meta-rabbits': 'monkeys', 'content-type': 'image/jpeg'}


I had a look at the source code and it looks like this is the libcloud function that is meant to be returning the data.

    def _headers_to_object(self, object_name, container, headers):
        meta_data = { 'content_type': headers['content-type'] }
        hash = headers['etag'].replace('"', '')
        obj = Object(name=object_name, size=headers['content-length'],
                     hash=hash, extra=None,
                     meta_data=meta_data,
                     container=container,
                     driver=self)
        return obj

As far as I can tell, the above code is not inserting the required data.

Anyone able to throw any light on this?

thanks

andrew

Reply via email to