Created
November 12, 2014 05:13
-
-
Save hrchu/ead7b2ee7494de24f74d to your computer and use it in GitHub Desktop.
Complete unfinished multipart upload by boto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto | |
from client import conn | |
bucket_name = '[YOUR BUCKET NAME]' | |
object_key = '[YOUR OBJECT KEY]' | |
upload_id = '[UPLOAD ID], can get it by s3cmd multipart s3://[YOUR BUCKET NAME]' | |
def main(): | |
bucket = conn.lookup(bucket_name) | |
complete_part_upload(bucket, object_key, upload_id) | |
def complete_part_upload(bucket, key_name, id): | |
mpu = boto.s3.multipart.MultiPartUpload() | |
mpu.bucket = bucket | |
mpu.key_name = key_name | |
mpu.id = id | |
mpu.complete_upload() | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment