Skip to content

Commit

Permalink
for file Operations (link,rename,mkdir,remove) in sender, separate
Browse files Browse the repository at this point in the history
the file op from the fileEvents, so that when fileEvents don't include
the operation, need to skip without falling through to file transfer.
working on #796
  • Loading branch information
petersilva committed Nov 6, 2023
1 parent ab43a40 commit f561029
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions sarracenia/flow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2450,6 +2450,33 @@ def do_send(self):

for msg in self.worklist.incoming:

# weed out non-file transfer operations that are configured to not be done.
if 'fileOp' in msg:
if ('directory' in msg['fileOp']) and ('remove' in msg['fileOp']) and ( 'rmdir' not in self.o.fileEvents ):
msg.setReport(202, "skipping rmdir here." )
self.worklist.ok.append(msg)
continue

elif ('remove' in msg['fileOp']) and ( 'delete' not in self.o.fileEvents ):
msg.setReport(202, "skipping delete here." )
self.worklist.ok.append(msg)
continue

if ('directory' in msg['fileOp']) and ( 'mkdir' not in self.o.fileEvents ):
msg.setReport(202, "skipping mkdir here." )
self.worklist.ok.append(msg)
continue

if ('hlink' in msg['fileOp']) and ( 'link' not in self.o.fileEvents ):
msg.setReport(202, "skipping hlink here." )
self.worklist.ok.append(msg)
continue

if ('link' in msg['fileOp']) and ( 'link' not in self.o.fileEvents ):
msg.setReport(202, "skipping link here." )
self.worklist.ok.append(msg)
continue

#=================================
# proceed to send : has to work
#=================================
Expand Down

0 comments on commit f561029

Please sign in to comment.