Export extractExTags and updateExclTags
[ganeti-local] / lib / asyncnotifier.py
index 9d5610e..f4b0815 100644 (file)
@@ -26,7 +26,7 @@ import asyncore
 import logging
 
 try:
-  # pylint: disable-msg=E0611
+  # pylint: disable=E0611
   from pyinotify import pyinotify
 except ImportError:
   import pyinotify
@@ -34,6 +34,7 @@ except ImportError:
 from ganeti import daemon
 from ganeti import errors
 
+
 # We contributed the AsyncNotifier class back to python-pyinotify, and it's
 # part of their codebase since version 0.8.7. This code can be removed once
 # we'll be ready to depend on python-pyinotify >= 0.8.7
@@ -41,7 +42,7 @@ class AsyncNotifier(asyncore.file_dispatcher):
   """An asyncore dispatcher for inotify events.
 
   """
-  # pylint: disable-msg=W0622,W0212
+  # pylint: disable=W0622,W0212
   def __init__(self, watch_manager, default_proc_fun=None, map=None):
     """Initializes this class.
 
@@ -89,7 +90,7 @@ class FileEventHandlerBase(pyinotify.ProcessEvent):
     @param watch_manager: inotify watch manager
 
     """
-    # pylint: disable-msg=W0231
+    # pylint: disable=W0231
     # no need to call the parent's constructor
     self.watch_manager = watch_manager
 
@@ -108,7 +109,9 @@ class FileEventHandlerBase(pyinotify.ProcessEvent):
 
     ret = result.get(filename, -1)
     if ret <= 0:
-      raise errors.InotifyError("Could not add inotify watcher (%s)" % ret)
+      raise errors.InotifyError("Could not add inotify watcher (error code %s);"
+                                " increasing fs.inotify.max_user_watches sysctl"
+                                " might be necessary" % ret)
 
     return result[filename]
 
@@ -167,7 +170,7 @@ class SingleFileEventHandler(FileEventHandlerBase):
     if self._watch_handle is not None and self.RemoveWatch(self._watch_handle):
       self._watch_handle = None
 
-  # pylint: disable-msg=C0103
+  # pylint: disable=C0103
   # this overrides a method in pyinotify.ProcessEvent
   def process_IN_IGNORED(self, event):
     # Since we monitor a single file rather than the directory it resides in,
@@ -181,7 +184,7 @@ class SingleFileEventHandler(FileEventHandlerBase):
     self._watch_handle = None
     self._callback(False)
 
-  # pylint: disable-msg=C0103
+  # pylint: disable=C0103
   # this overrides a method in pyinotify.ProcessEvent
   def process_IN_MODIFY(self, event):
     # This gets called when the monitored file is modified. Note that this