Miserlou / django-aws-billing

Django AWS Usage/Billing Package.
MIT License
14 stars 5 forks source link

Exception: remote file not ready #7

Open Miserlou opened 10 years ago

Miserlou commented 10 years ago

Got this exception when running process_aws_billing

Exception: remote file not ready : s3://the-name-of-my-aws-billing-info-bucket/5721-0777-0384-aws-billing-detailed-line-items-with-resources-and-tags-2014-04.csv.zip

Don't know why - I assume the file just wasn't ready yet.

It sorted itself out eventually, so it's not critical yet, but I'd like to have better handling when this occurs.

zerosoul13 commented 10 years ago

Maybe adding this would work:

http://boto.readthedocs.org/en/latest/s3_tut.html#restoring-objects-from-glacier

key = bucket.get_key('logs/testlog1.log') print key.ongoing_restore True

If value is False we could attempt the retrieval of the file. Otherwise you'll get the except.