#NEWLINE# def _reconcile_object( self , account , container , obj , q_policy_index , q_ts , q_op , path , **kwargs ) : #NEWLINE# #INDENT# '\n        Perform object reconciliation.\n\n        :param account: the account name of the misplaced object\n        :param container: the container name of the misplaced object\n        :param obj: the object name\n        :param q_policy_index: the policy index of the source indicated by the\n                               queue entry.\n        :param q_ts: the timestamp of the misplaced object\n        :param q_op: the operation of the misplaced request\n        :param path: the full path of the misplaced object for logging\n\n        :returns: True to indicate the request is fully processed\n                  successfully, otherwise False.\n        ' #NEWLINE# container_policy_index = direct_get_container_policy_index ( self . swift . container_ring , account , container ) #NEWLINE# if ( container_policy_index is None ) : #NEWLINE# #INDENT# self . stats_log ( 'unavailable_container' , '%r (%f) unable to determine the destination policy_index' , path , q_ts ) #NEWLINE# return False #NEWLINE# #UNINDENT# if ( container_policy_index == q_policy_index ) : #NEWLINE# #INDENT# self . stats_log ( 'noop_object' , '%r (%f) container policy_index %s matches queue policy index %s' , path , q_ts , container_policy_index , q_policy_index ) #NEWLINE# return True #NEWLINE# #UNINDENT# self . logger . debug ( 'checking for %r (%f) in destination policy_index %s' , path , q_ts , container_policy_index ) #NEWLINE# headers = { #NEWLINE# #INDENT# 'X-Backend-Storage-Policy-Index' : container_policy_index , #NEWLINE# #UNINDENT# } #NEWLINE# dest_obj = self . swift . get_object_metadata ( account , container , obj , headers = headers , acceptable_statuses = ( 2 , 4 ) ) #NEWLINE# dest_ts = Timestamp ( dest_obj . get ( 'x-backend-timestamp' , 0 ) ) #NEWLINE# if ( dest_ts >= q_ts ) : #NEWLINE# #INDENT# self . stats_log ( 'found_object' , '%r (%f) in policy_index %s is newer than queue (%f)' , path , kwargs , container_policy_index , q_ts ) #NEWLINE# return self . throw_tombstones ( account , container , obj , q_ts , q_policy_index , path ) #NEWLINE# #UNINDENT# self . stats_log ( 'misplaced_object' , '%r (%f) in policy_index %s should be in policy_index %s' , path , q_ts , q_policy_index , container_policy_index ) #NEWLINE# self . logger . debug ( 'fetching %r (%f) from storage policy %s' , path , q_ts , q_policy_index ) #NEWLINE# headers = { #NEWLINE# #INDENT# 'X-Backend-Storage-Policy-Index' : q_policy_index , #NEWLINE# #UNINDENT# } #NEWLINE# try : #NEWLINE# #INDENT# ( source_obj_status , source_obj_info , source_obj_iter ) = self . swift . get_object ( account , container , obj , headers = headers , acceptable_statuses = ( 2 , 4 ) ) #NEWLINE# #UNINDENT# except UnexpectedResponse as err : #NEWLINE# #INDENT# source_obj_status = err . resp . status_int #NEWLINE# source_obj_info = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# source_obj_iter = None #NEWLINE# #UNINDENT# source_ts = Timestamp ( source_obj_info . get ( 'x-backend-timestamp' , 0 ) ) #NEWLINE# if ( ( source_obj_status == 404 ) and ( q_op == 'DELETE' ) ) : #NEWLINE# #INDENT# return self . ensure_tombstone_in_right_location ( q_policy_index , account , container , obj , q_ts , path , container_policy_index , source_ts ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return self . ensure_object_in_right_location ( q_policy_index , account , container , obj , q_ts , path , container_policy_index , source_ts , source_obj_status , source_obj_info , source_obj_iter )