From f91c72231c9b5d91dcc7d2c88f88460d7600c734 Mon Sep 17 00:00:00 2001
From: Guido Trotter <ultrotter@google.com>
Date: Wed, 19 Aug 2009 14:47:17 +0200
Subject: [PATCH] Convert ganeti-confd to Mainloop

Now that mainloop is asyncore-enabled we can easily do that.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 daemons/ganeti-confd | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/daemons/ganeti-confd b/daemons/ganeti-confd
index 9743d2df8..df026da41 100755
--- a/daemons/ganeti-confd
+++ b/daemons/ganeti-confd
@@ -199,6 +199,8 @@ def ExecCONFD(options, args):
   """Main CONFD function, executed with pidfile held
 
   """
+  mainloop = daemon.Mainloop()
+
   # confd-level SimpleConfigReader
   reader = ssconf.SimpleConfigReader()
 
@@ -210,7 +212,8 @@ def ExecCONFD(options, args):
   wm = pyinotify.WatchManager()
   confd_event_handler = ConfdInotifyEventHandler(wm, reader)
   notifier = AsyncNotifier(wm, confd_event_handler)
-  asyncore.loop()
+
+  mainloop.Run()
 
 
 def main():
-- 
GitLab