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

fix checksum checking.

parent d9c4556f
No related branches found
No related tags found
No related merge requests found
...@@ -429,7 +429,8 @@ def confirmed_put( irods_sesh, file_pathname, new_obj_ipath, metadata_dict=None, ...@@ -429,7 +429,8 @@ def confirmed_put( irods_sesh, file_pathname, new_obj_ipath, metadata_dict=None,
existing_obj = None existing_obj = None
try: try:
existing_obj = irods_sesh.data_objects.get( new_obj_ipath ) options = {kw.VERIFY_CHKSUM_KW: ''}
existing_obj = irods_sesh.data_objects.get( new_obj_ipath, **options )
logging.debug( "Object aleady exists at ipath: " + new_obj_ipath ) logging.debug( "Object aleady exists at ipath: " + new_obj_ipath )
except irods_ex.DataObjectDoesNotExist: except irods_ex.DataObjectDoesNotExist:
logging.debug( "DataObjectDoesNotExist " + new_obj_ipath ) logging.debug( "DataObjectDoesNotExist " + new_obj_ipath )
...@@ -444,14 +445,14 @@ def confirmed_put( irods_sesh, file_pathname, new_obj_ipath, metadata_dict=None, ...@@ -444,14 +445,14 @@ def confirmed_put( irods_sesh, file_pathname, new_obj_ipath, metadata_dict=None,
if existing_obj != None: if existing_obj != None:
# https://github.com/irods/python-irodsclient/blob/main/irods/test/collection_test.py#L317 # https://github.com/irods/python-irodsclient/blob/main/irods/test/collection_test.py#L317
# file_digest = helpers.compute_sha256_digest( file_pathname ) #file_digest = helpers.compute_sha256_digest( file_pathname )
# logging.error( "irods checksum: " + str( existing_obj.checksum ) + " new_obj_hash_256 " + str( new_obj_hash_256 ) + " file_digest " + str( file_digest ) ) #logging.error( "irods checksum: " + str( existing_obj.chksum() ) + " new_obj_hash_256 " + str( new_obj_hash_256 ) + " file_digest " + str( file_digest ) )
if existing_obj.checksum != new_obj_hash_256 : if existing_obj.chksum() != new_obj_hash_256 :
mismatch = True mismatch = True
mismatch_reason = "data csm" mismatch_reason = "data csm"
logging.debug( "Object prexists but data mismatches." logging.debug( "Object pre-exists 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
......
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