~launchpad-pqm/launchpad/devel

14027.3.2 by Jeroen Vermeulen
Merge devel, resolve conflicts.
1
# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
8687.15.8 by Karl Fogel
Add the copyright header block to more files.
2
# GNU Affero General Public License version 3 (see the file LICENSE).
7813.2.1 by Celso Providelo
re-basing slave-scanner-ng changes.
3
4
# Twisted Application Configuration file.
5
# Use with "twistd2.4 -y <file.tac>", e.g. "twistd -noy server.tac"
6
7
from twisted.application import service
11121.2.2 by Henning Eggers
Use logile name from command line options.
8
from twisted.scripts.twistd import ServerOptions
7813.2.1 by Celso Providelo
re-basing slave-scanner-ng changes.
9
from twisted.web import server
10
14022.3.15 by William Grant
Fix buildd-manager.tac import properly.
11
from canonical.config import dbconfig
11765.1.1 by Robert Collins
Split out the launchpad-buildd needed component from tachandler.py.
12
from canonical.launchpad.daemons import readyservice
7813.2.1 by Celso Providelo
re-basing slave-scanner-ng changes.
13
from canonical.launchpad.scripts import execute_zcml_for_scripts
14022.2.8 by William Grant
Fix buildd-manager.tac import.
14
from lp.buildmaster.manager import BuilddManager
15
from lp.services.mail.sendmail import set_immediate_mail_delivery
16
from lp.services.twistedsupport.loggingsupport import RotatableFileLogObserver
7813.2.1 by Celso Providelo
re-basing slave-scanner-ng changes.
17
18
execute_zcml_for_scripts()
14022.3.1 by William Grant
Replace initZopeless mostly.
19
dbconfig.override(dbuser='buildd_manager', isolation_level='read_committed')
14022.2.4 by William Grant
Move set_immediate_mail_delivery into initZopeless' callsites, out of initZopeless itself.
20
# XXX wgrant 2011-09-24 bug=29744: initZopeless used to do this.
21
# Should be removed from callsites verified to not need it.
22
set_immediate_mail_delivery(True)
7813.2.1 by Celso Providelo
re-basing slave-scanner-ng changes.
23
11121.2.2 by Henning Eggers
Use logile name from command line options.
24
options = ServerOptions()
25
options.parseOptions()
26
7813.2.1 by Celso Providelo
re-basing slave-scanner-ng changes.
27
application = service.Application('BuilddManager')
11121.2.1 by Henning Eggers
Implemented RotatableFileLogObserver.
28
application.addComponent(
11121.2.2 by Henning Eggers
Use logile name from command line options.
29
    RotatableFileLogObserver(options.get('logfile')), ignoreClass=1)
8486.7.1 by Celso Providelo
Fixing bug #380848 (buildd-manager circular imports, also testing if the TAC file starts and stops correctly).
30
31
# Service that announces when the daemon is ready.
11765.1.1 by Robert Collins
Split out the launchpad-buildd needed component from tachandler.py.
32
readyservice.ReadyService().setServiceParent(application)
8486.7.1 by Celso Providelo
Fixing bug #380848 (buildd-manager circular imports, also testing if the TAC file starts and stops correctly).
33
34
# Service for scanning buildd slaves.
7813.2.1 by Celso Providelo
re-basing slave-scanner-ng changes.
35
service = BuilddManager()
36
service.setServiceParent(application)
8486.7.1 by Celso Providelo
Fixing bug #380848 (buildd-manager circular imports, also testing if the TAC file starts and stops correctly).
37