From 4eb411af162c1df9e3b6783a9c195b59c143970f Mon Sep 17 00:00:00 2001 From: Siddharth Ravikumar Date: Fri, 6 Mar 2015 08:35:02 -0500 Subject: updated the on_delete method in the combox.events.ComboxDirMonitor class. It now deletes the directory or file shard in the node directories only if they were not already deleted. modified: combox/events.py --- combox/events.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/combox/events.py b/combox/events.py index d3d845a..fc0d932 100644 --- a/combox/events.py +++ b/combox/events.py @@ -148,10 +148,13 @@ class ComboxDirMonitor(LoggingEventHandler): super(ComboxDirMonitor, self).on_deleted(event) self.silo_update() - if event.is_directory: + file_node_path = node_path(event.src_path, self.config, + not event.is_directory) + + if event.is_directory and (path.exists(file_node_path)): # Delete corresponding directory in the nodes. rm_nodedir(event.src_path, self.config) - else: + elif(not event.is_directory) and (path.exists(file_node_path)): # remove the corresponding file shards in the node # directories. rm_shards(event.src_path, self.config) -- cgit v1.2.3