From 38bb65c3009cd9578358bd60054ff6f2b714b87c Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Fri, 20 Jul 2012 08:55:35 -0400 Subject: strip trailing slashes from inotify watches --- src/lib/Bcfg2/Server/FileMonitor/Inotify.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/lib/Bcfg2/Server/FileMonitor/Inotify.py b/src/lib/Bcfg2/Server/FileMonitor/Inotify.py index bf540a1c6..7362432b8 100644 --- a/src/lib/Bcfg2/Server/FileMonitor/Inotify.py +++ b/src/lib/Bcfg2/Server/FileMonitor/Inotify.py @@ -72,6 +72,8 @@ class Inotify(Pseudo, pyinotify.ProcessEvent): self.events.append(evt) def AddMonitor(self, path, obj): + # strip trailing slashes + path = path.rstrip("/") if not os.path.isdir(path): # inotify is a little wonky about watching files. for # instance, if you watch /tmp/foo, and then do 'mv -- cgit v1.2.3-1-g7c22