'Finish a multipart upload
http://docs.amazonwebservices.com/AmazonS3/latest/API/index.html?mpUploadComplete.html'

def complete_multipart_upload(self):

    debug(('MultiPart:    Completing    upload:    %s' % self.upload_id))
    parts_xml = []
    part_xml = '<Part><PartNumber>%i</PartNumber><ETag>%s</ETag></Part>'
    for (seq, etag) in self.parts.items():
        parts_xml.append((part_xml % (seq, etag)))
    body = ('<CompleteMultipartUpload>%s</CompleteMultipartUpload>' % ''.join(parts_xml))
    headers = {'content-length': str(len(body))}
    request = self.s3.create_request('OBJECT_POST', uri=self.uri, headers=headers, body=body, uri_params={'uploadId': self.upload_id})
    response = self.s3.send_request(request)
    return response
