ganeti-confd: Call pyinotify flags correctly
authorGuido Trotter <ultrotter@google.com>
Mon, 22 Mar 2010 16:25:27 +0000 (16:25 +0000)
committerGuido Trotter <ultrotter@google.com>
Tue, 23 Mar 2010 09:31:09 +0000 (09:31 +0000)
The "apparently pylint was right" commit.

Although the pyinotify constants work on old distributions, they fail on
new ones, with new python. Fixing this by calling them in a way that
works everywhere.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

daemons/ganeti-confd

index c793159..290f618 100755 (executable)
@@ -106,10 +106,8 @@ class ConfdInotifyEventHandler(pyinotify.ProcessEvent):
     # no need to call the parent's constructor
     self.watch_manager = watch_manager
     self.callback = callback
-    # pylint: disable-msg=E1103
-    # pylint for some reason doesn't see the below constants
-    self.mask = pyinotify.EventsCodes.IN_IGNORED | \
-                pyinotify.EventsCodes.IN_MODIFY
+    self.mask = pyinotify.EventsCodes.ALL_FLAGS["IN_IGNORED"] | \
+                pyinotify.EventsCodes.ALL_FLAGS["IN_MODIFY"]
     self.file = filename
     self.watch_handle = None