summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTorsten Rehn <torsten@rehn.tel>2011-07-04 15:14:48 +0200
committerTorsten Rehn <torsten@rehn.tel>2011-07-04 15:14:48 +0200
commit992cdc75ed8be5650ce5beca902950edd3b961e3 (patch)
treeab509d1c556357edb3c4c062991dbe80bc579d60
parent9070f86fcfa6248971474581f7b47aa1b4854ac4 (diff)
downloadbcfg2-992cdc75ed8be5650ce5beca902950edd3b961e3.tar.gz
bcfg2-992cdc75ed8be5650ce5beca902950edd3b961e3.tar.bz2
bcfg2-992cdc75ed8be5650ce5beca902950edd3b961e3.zip
prevent KeyErrors when directories get changed by rsync
This wasn't originally anticipated, but if a repository is updated via rsync, HandleEvent() receives 'changed' actions for directories as well. Directories aren't present in self.entries and consequently caused KeyErrors.
-rw-r--r--src/lib/Server/Plugin.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/Server/Plugin.py b/src/lib/Server/Plugin.py
index 3841e637d..a05c537e5 100644
--- a/src/lib/Server/Plugin.py
+++ b/src/lib/Server/Plugin.py
@@ -927,7 +927,7 @@ class GroupSpool(Plugin, Generator):
if not posixpath.isdir(epath):
# do not pass through directory events
self.entries[ident].handle_event(event)
- if action == 'changed':
+ if action == 'changed' and ident in self.entries:
self.entries[ident].handle_event(event)
elif action == 'deleted':
fbase = self.handles[event.requestID] + event.filename