summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Bcfg2/Server/FileMonitor/Inotify.py5
-rw-r--r--src/lib/Bcfg2/Server/FileMonitor/__init__.py4
2 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Server/FileMonitor/Inotify.py b/src/lib/Bcfg2/Server/FileMonitor/Inotify.py
index e4948ea8d..097fc0b42 100644
--- a/src/lib/Bcfg2/Server/FileMonitor/Inotify.py
+++ b/src/lib/Bcfg2/Server/FileMonitor/Inotify.py
@@ -40,7 +40,10 @@ class Inotify(Pseudo, pyinotify.ProcessEvent):
self.add_q = []
def fileno(self):
- return self.wm.get_fd()
+ if self.started:
+ return self.wm.get_fd()
+ else:
+ return None
def process_default(self, ievent):
action = ievent.maskname
diff --git a/src/lib/Bcfg2/Server/FileMonitor/__init__.py b/src/lib/Bcfg2/Server/FileMonitor/__init__.py
index a9bf50ccf..251e04e4f 100644
--- a/src/lib/Bcfg2/Server/FileMonitor/__init__.py
+++ b/src/lib/Bcfg2/Server/FileMonitor/__init__.py
@@ -42,7 +42,9 @@ class FileMonitor(object):
return "%s: %s" % (__name__, self.__class__.__name__)
def __repr__(self):
- return "%s (%s events, fd %s)" % (str(self), len(self.events), self.fileno)
+ return "%s (%s events, fd %s)" % (self.__class__.__name__,
+ len(self.events),
+ self.fileno())
def start(self):
""" start threads or anything else that needs to be done after