2017-08-28 7 views
0

私はBoto s3パッケージを使用して、自分のバケットのすべての内容を表示しています。もし私がこのようなことをすれば、Python Amazon Boto S3 ongoing_restore bug

bucket = s3.get_bucket('my_bucket_name') 
for k in bucket: 
    print k.ongoing_restore 

スニペットはすべてのオブジェクトに対してNoneを出力します。しかし、私が特定のキーを取得した場合:

k = bucket.get_key('my_key') 
k.ongoing_restore 

次に、出力はTrueになります。何らかの理由で、値が最初のコードセットで正しく設定されていないため、理由を把握できません。どんな助けにも感謝!

答えて

0

状況を再現できません。

通常、.__dict__を使用してオブジェクトをデバッグできます。ここで

は私の出力です:

>>> import boto 
>>> s3=boto.connect_s3() 
>>> bucket = s3.get_bucket('my-bucket') 
>>> for k in bucket: 
... print k.ongoing_restore 
... 
None 
None 
None 
None 
None 
None 
None 
None 
None 
None 
None 
None 
None 
None 
None 
None 
None 
None 
None 
>>> k = bucket.get_key('foo.zip') 
>>> k.ongoing_restore 
>>> k.__dict__ 
{'content_length': '234', 'encrypted': None, 'resp': None, 'ongoing_restore': None, 'source_version_id': None, 'content_language': None, '_storage_class': None, 'owner': None, 'filename': None, 'size': 234, 'delete_marker': False, 'etag': '"..."', 'content_encoding': None, 'content_md5': None, 'content_disposition': None, 'cache_control': None, 'metadata': {}, 'expires': None, 'version_id': None, 'x_robots_tag': None, 'last_modified': 'Sun, 06 Aug 2017 03:23:22 GMT', 'content_type': 'application/json', 'date': 'Mon, 28 Aug 2017 22:40:25 GMT', 'path': None, 'is_latest': False, 'local_hashes': {}, 'name': 'foo.zip', 'bucket': <Bucket: my-bucket>, 'expiry_date': None, 'mode': None} 
>>> 
関連する問題