=== modified file '.bzrignore'
@@ -1,3 +1,4 @@
*.egg-info
./twistd.pid
./_trial_temp
+./twisted/plugins/dropin.cache
=== added directory 'twisted'
=== added directory 'twisted/plugins'
=== renamed file 'lava-scheduler-daemon.tac' => 'twisted/plugins/twisted_lava_scheduler_daemon.py'
@@ -1,26 +1,32 @@
-import logging
import os
-import sys
-
-from twisted.application import service
-from twisted.application import internet
-from twisted.python import filepath
-from twisted.internet import reactor
+
+from twisted.python import usage
+from twisted.plugin import IPlugin
+from twisted.application.service import IServiceMaker
+
+from zope.interface import implements
from lava_scheduler_daemon.service import BoardSet
-os.environ['DJANGO_SETTINGS_MODULE'] = 'lava_server.settings.development'
-from lava_scheduler_daemon.dbjobsource import DatabaseJobSource
-
-application = service.Application("lava scheduler daemon")
-
-
-#source = DirectoryJobSource(filepath.FilePath('/tmp/lava-jobs'))
-source = DatabaseJobSource()
-board_set = BoardSet(source, 'fake-dispatcher', reactor)
-board_set.setServiceParent(application)
-
-logger = logging.getLogger('')
-handler = logging.StreamHandler(sys.stdout)
-handler.setFormatter(logging.Formatter("[%(name)s] %(message)s"))
-logger.addHandler(handler)
-logger.setLevel(logging.DEBUG)
+
+class MyServiceMaker(object):
+ implements(IServiceMaker, IPlugin)
+ tapname = "lava-scheduler-daemon"
+ description = "Run the LAVA Scheduler Daemon"
+ options = usage.Options
+
+ def makeService(self, options):
+ """
+ Construct a TCPServer from a factory defined in myproject.
+ """
+ os.environ['DJANGO_SETTINGS_MODULE'] = 'lava_server.settings.development'
+ from lava_scheduler_daemon.dbjobsource import DatabaseJobSource
+ from twisted.internet import reactor
+ source = DatabaseJobSource()
+ return BoardSet(source, 'lava-dispatch', reactor)
+
+
+# Now construct an object which *provides* the relevant interfaces
+# The name of this variable is irrelevant, as long as there is *some*
+# name bound to a provider of IPlugin and IServiceMaker.
+
+serviceMaker = MyServiceMaker()