From patchwork Thu Jul 7 09:59:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael-Doyle Hudson X-Patchwork-Id: 2522 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 4B2FB24145 for ; Thu, 7 Jul 2011 09:59:19 +0000 (UTC) Received: from mail-qy0-f180.google.com (mail-qy0-f180.google.com [209.85.216.180]) by fiordland.canonical.com (Postfix) with ESMTP id 17685A182BC for ; Thu, 7 Jul 2011 09:59:19 +0000 (UTC) Received: by mail-qy0-f180.google.com with SMTP id 30so542311qyk.11 for ; Thu, 07 Jul 2011 02:59:18 -0700 (PDT) Received: by 10.229.54.12 with SMTP id o12mr447329qcg.80.1310032758850; Thu, 07 Jul 2011 02:59:18 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.48.135 with SMTP id r7cs103923qcf; Thu, 7 Jul 2011 02:59:18 -0700 (PDT) Received: by 10.227.201.144 with SMTP id fa16mr548828wbb.19.1310032754508; Thu, 07 Jul 2011 02:59:14 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id ek19si18437391wbb.106.2011.07.07.02.59.14; Thu, 07 Jul 2011 02:59:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) client-ip=91.189.90.139; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) smtp.mail=bounces@canonical.com Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QelMX-0001Yc-Hx for ; Thu, 07 Jul 2011 09:59:13 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 85B692E8915 for ; Thu, 7 Jul 2011 09:59:13 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-scheduler X-Launchpad-Branch: ~linaro-validation/lava-scheduler/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 19 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-scheduler/trunk] Rev 19: give up on twistd Message-Id: <20110707095913.31225.46073.launchpad@loganberry.canonical.com> Date: Thu, 07 Jul 2011 09:59:13 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13376"; Instance="initZopeless config overlay" X-Launchpad-Hash: e1a7f5144ce78979f96a66dfde6424d3e6ffbefe ------------------------------------------------------------ revno: 19 committer: Michael-Doyle Hudson branch nick: trunk timestamp: Thu 2011-07-07 21:45:09 +1200 message: give up on twistd renamed: twisted/plugins/twistd_lava_scheduler_daemon.py => lava-scheduler* modified: lava-scheduler* --- lp:lava-scheduler https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk You are subscribed to branch lp:lava-scheduler. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk/+edit-subscription === renamed file 'twisted/plugins/twistd_lava_scheduler_daemon.py' => 'lava-scheduler' (properties changed: -x to +x) --- twisted/plugins/twistd_lava_scheduler_daemon.py 2011-07-07 04:19:36 +0000 +++ lava-scheduler 2011-07-07 09:45:09 +0000 @@ -1,32 +1,23 @@ +#/usr/bin/python +import logging import os - -from twisted.python import usage -from twisted.plugin import IPlugin -from twisted.application.service import IServiceMaker - -from zope.interface import implements +import sys + +from twisted.internet import reactor from lava_scheduler_daemon.service import BoardSet -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() +os.environ['DJANGO_SETTINGS_MODULE'] = 'lava_server.settings.development' +from lava_scheduler_daemon.dbjobsource import DatabaseJobSource + +source = DatabaseJobSource() +service = BoardSet(source, 'lava-dispatch', reactor) +reactor.callWhenRunning(service.startService) + +logger = logging.getLogger('') +handler = logging.StreamHandler(sys.stdout) +handler.setFormatter(logging.Formatter("[%(name)s] %(message)s")) +logger.addHandler(handler) +logger.setLevel(logging.DEBUG) + +reactor.run()