On some distributions pyinotify is installed in a different way, and the
actual module just contains an internal pyinotify entry, which is the
actual library. On others the main pyinotify module contains the library
itself. We'll try both, in order to be more compatible.

Signed-off-by: Guido Trotter <[email protected]>
---
(committing against devel-2.1 is ok as well, for me)

 daemons/ganeti-confd |    6 +++++-
 lib/asyncnotifier.py |    6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/daemons/ganeti-confd b/daemons/ganeti-confd
index c560e7f..b3cf688 100755
--- a/daemons/ganeti-confd
+++ b/daemons/ganeti-confd
@@ -29,9 +29,13 @@ It uses UDP+HMAC for authentication with a global cluster 
key.
 import os
 import sys
 import logging
-import pyinotify
 import time
 
+try:
+  from pyinotify import pyinotify
+except ImportError:
+  import pyinotify
+
 from optparse import OptionParser
 
 from ganeti import asyncnotifier
diff --git a/lib/asyncnotifier.py b/lib/asyncnotifier.py
index 1498ad0..a0fb2d0 100644
--- a/lib/asyncnotifier.py
+++ b/lib/asyncnotifier.py
@@ -22,9 +22,13 @@
 """Asynchronous pyinotify implementation"""
 
 
-import pyinotify
 import asyncore
 
+try:
+    from pyinotify import pyinotify
+except ImportError:
+    import pyinotify
+
 
 class AsyncNotifier(asyncore.file_dispatcher):
   """An asyncore dispatcher for inotify events.
-- 
1.6.5

Reply via email to