#NEWLINE# def __call__( self ) : #NEWLINE# #INDENT# LOGGER . debug ( 'Completing multipart upload for file: %s' , self . filename . src ) #NEWLINE# upload_id = self . _upload_context . wait_for_upload_id ( ) #NEWLINE# parts = self . _upload_context . wait_for_parts_to_finish ( ) #NEWLINE# LOGGER . debug ( 'Received upload id and parts list.' ) #NEWLINE# ( bucket , key ) = find_bucket_key ( self . filename . dest ) #NEWLINE# params = { #NEWLINE# #INDENT# 'Bucket' : bucket , #NEWLINE# 'Key' : key , #NEWLINE# 'UploadId' : upload_id , #NEWLINE# 'MultipartUpload' : { #NEWLINE# #INDENT# 'Parts' : parts , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# try : #NEWLINE# #INDENT# response_data = self . filename . client . complete_multipart_upload ( ** params ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# LOGGER . debug ( 'Error trying to complete multipart upload: %s' , e , exc_info = True ) #NEWLINE# message = print_operation ( self . filename , failed = True , dryrun = self . parameters [ 'dryrun' ] ) #NEWLINE# message += ( '\n' + str ( e ) ) #NEWLINE# result = { #NEWLINE# #INDENT# 'message' : message , #NEWLINE# 'error' : True , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# LOGGER . debug ( 'Multipart upload completed for: %s' , self . filename . src ) #NEWLINE# message = print_operation ( self . filename , False , self . parameters [ 'dryrun' ] ) #NEWLINE# result = { #NEWLINE# #INDENT# 'message' : message , #NEWLINE# 'error' : False , #NEWLINE# #UNINDENT# } #NEWLINE# self . _upload_context . announce_completed ( ) #NEWLINE# #UNINDENT# self . result_queue . put ( PrintTask ( ** result ) )