From f561029ed83f24e00bda3ee85fa82d6ab617accc Mon Sep 17 00:00:00 2001 From: Peter Silva Date: Sat, 28 Oct 2023 14:30:16 -0400 Subject: [PATCH] for file Operations (link,rename,mkdir,remove) in sender, separate 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 --- sarracenia/flow/__init__.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/sarracenia/flow/__init__.py b/sarracenia/flow/__init__.py index f44b7f7e1..b3c52a04a 100644 --- a/sarracenia/flow/__init__.py +++ b/sarracenia/flow/__init__.py @@ -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 #=================================