summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiddharth Ravikumar <sravik@bgsu.edu>2015-03-06 08:35:02 -0500
committerSiddharth Ravikumar <sravik@bgsu.edu>2015-03-06 08:35:02 -0500
commit4eb411af162c1df9e3b6783a9c195b59c143970f (patch)
treece979fea6d5911d33964ad8fd1721229df34ba81
parent2c7c011d68691ffe3aa7d308479e7204c2727617 (diff)
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
-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)