diff options
author | Sol Jerome <sol.jerome@gmail.com> | 2013-03-21 09:36:34 -0500 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2013-03-21 09:36:34 -0500 |
commit | 7d22e7fe4bff3c229ed0cb8d3a792e508ba13cce (patch) | |
tree | 54d1dfc689ef0e4bc0d0c178c45e3fd55901d77a /src/lib/Bcfg2/Server/FileMonitor | |
parent | 98ef06e6a0426958f476f2835839aea5de3f7bc6 (diff) | |
parent | 5feb76d97c6b26228dcf521659f434c6b576310c (diff) | |
download | bcfg2-7d22e7fe4bff3c229ed0cb8d3a792e508ba13cce.tar.gz bcfg2-7d22e7fe4bff3c229ed0cb8d3a792e508ba13cce.tar.bz2 bcfg2-7d22e7fe4bff3c229ed0cb8d3a792e508ba13cce.zip |
Merge branch 'maint'
Diffstat (limited to 'src/lib/Bcfg2/Server/FileMonitor')
-rw-r--r-- | src/lib/Bcfg2/Server/FileMonitor/Inotify.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/Bcfg2/Server/FileMonitor/Inotify.py b/src/lib/Bcfg2/Server/FileMonitor/Inotify.py index 178a47b1a..b44ff6970 100644 --- a/src/lib/Bcfg2/Server/FileMonitor/Inotify.py +++ b/src/lib/Bcfg2/Server/FileMonitor/Inotify.py @@ -2,6 +2,7 @@ support. """ import os +import errno import logging import pyinotify from Bcfg2.Compat import reduce # pylint: disable=W0622 @@ -182,6 +183,9 @@ class Inotify(Pseudo, pyinotify.ProcessEvent): try: watchdir = self.watches_by_path[watch_path] except KeyError: + if not os.path.exists(watch_path): + raise OSError(errno.ENOENT, + "No such file or directory: '%s'" % path) watchdir = self.watchmgr.add_watch(watch_path, self.mask, quiet=False)[watch_path] self.watches_by_path[watch_path] = watchdir |