Commit ef4ca33b authored by Guido Trotter's avatar Guido Trotter
Browse files

ConfdInotifyEventHandler.enable: use InotifyError

Rather than raising ConfdFatalError directly
ConfdInotifyEventHandler.enable raises InotifyError should it not be
able to configure inotify, allowing the caller to decide what to do.
Signed-off-by: default avatarGuido Trotter <>
Reviewed-by: default avatarMichael Hanselmann <>
parent 589dee9a
...@@ -123,7 +123,7 @@ class ConfdInotifyEventHandler(pyinotify.ProcessEvent): ...@@ -123,7 +123,7 @@ class ConfdInotifyEventHandler(pyinotify.ProcessEvent):
if self.watch_handle is None: if self.watch_handle is None:
result = self.watch_manager.add_watch(self.file, self.mask) result = self.watch_manager.add_watch(self.file, self.mask)
if not self.file in result or result[self.file] <= 0: if not self.file in result or result[self.file] <= 0:
raise errors.ConfdFatalError("Could not add inotify watcher") raise errors.InotifyError("Could not add inotify watcher")
else: else:
self.watch_handle = result[self.file] self.watch_handle = result[self.file]
...@@ -213,7 +213,10 @@ class ConfdConfigurationReloader(object): ...@@ -213,7 +213,10 @@ class ConfdConfigurationReloader(object):
""" """
if not notifier_enabled: if not notifier_enabled:
self.inotify_handler.enable() self.inotify_handler.enable()
except errors.InotifyError:
raise errors.ConfdFatalError(err)
try: try:
reloaded = self.reader.Reload() reloaded = self.reader.Reload()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment