Skip to content
Snippets Groups Projects
Commit f8b3dbf9 authored by Blake Fitch's avatar Blake Fitch
Browse files

reduce log lines on object mismatch to one

parent 2768f7f8
No related branches found
Tags STAG-2024-04-15-20-30-24
No related merge requests found
...@@ -445,18 +445,20 @@ def confirmed_put( irods_sesh, file_pathname, new_obj_ipath, metadata_dict=None, ...@@ -445,18 +445,20 @@ def confirmed_put( irods_sesh, file_pathname, new_obj_ipath, metadata_dict=None,
if existing_obj.checksum != new_obj_hash_256 : if existing_obj.checksum != new_obj_hash_256 :
mismatch = True mismatch = True
logging.error( "Object prexists but data mismatches." mismatch_reason = "data csm"
logging.debug( "Object prexists but data mismatches."
+ " file_pathname " + file_pathname ) + " file_pathname " + file_pathname )
else: else:
# Get the existing objects metadata as a python dict # Get the existing objects metadata as a python dict
existing_obj_dict = irods_avus_to_pydict( existing_obj ) existing_obj_dict = irods_avus_to_pydict( existing_obj )
if existing_obj_dict != metadata_dict: if existing_obj_dict != metadata_dict:
logging.error( "Object matches on data but mismatches metadata." logging.debug( "Object matches on data but mismatches metadata."
+ " new avu dict: " + str( metadata_dict ) + " new avu dict: " + str( metadata_dict )
+ " existing dict: " + str( existing_obj_dict ) + " existing dict: " + str( existing_obj_dict )
+ " file_pathname: " + file_pathname ) + " file_pathname: " + file_pathname )
mismatch = True mismatch = True
mismatch_reason = "metadata"
if mismatch: if mismatch:
# Mismatch existing object. Move the old object out of the way and date it. # Mismatch existing object. Move the old object out of the way and date it.
...@@ -468,7 +470,7 @@ def confirmed_put( irods_sesh, file_pathname, new_obj_ipath, metadata_dict=None, ...@@ -468,7 +470,7 @@ def confirmed_put( irods_sesh, file_pathname, new_obj_ipath, metadata_dict=None,
+ " path " + existing_obj.path + " path " + existing_obj.path
+ " ex: " + str( ex ) ) + " ex: " + str( ex ) )
return None return None
logging.warn( "Moved mismatching existing object to ipath: " + dup_ipath ) logging.warn( f"Moved mismatching existing object (reason: {mismatch_reason}) to ipath: {dup_ipath}" )
# Fall through to move newly uploaded object into place. # Fall through to move newly uploaded object into place.
else: else:
# Matching existing object. Remove the tmp object we just uploaded and leave the old one. # Matching existing object. Remove the tmp object we just uploaded and leave the old one.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment