irods / irods_capability_automated_ingest

Other
12 stars 15 forks source link

Investigate no operation in ```sync_file``` defaulting to ```REGISTER_SYNC``` #208

Open avkrishnamurthy opened 1 year ago

avkrishnamurthy commented 1 year ago

Currently in sync_file, when the operation is none, it sets the operation to be REGISTER_SYNC. However, sync_file should only be run for operations PUT_SYNC and PUT_APPEND. More investigation is needed to decide what the behavior should be if we reach sync_file with no operation.

avkrishnamurthy commented 1 year ago
image

I believe this snippet of code in sync_data_from_file in sync_irods.py is the only entrypoint into the sync_file function, so it should not be possible for op to be none.

I think the idea of setting op=Operation.REGISTER_SYNC if it was none in sync_filecomes from the snippet below which is also in sync_data_from_file, but the code should never be able to reach sync_file with op=Operation.REGISTER_SYNC anyway, so I think it can safely be removed in sync_file.

image