summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--combox/events.py7
1 files 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)