Trees | Indices | Help |
|
---|
|
1 # This file is part of Buildbot. Buildbot is free software: you can 2 # redistribute it and/or modify it under the terms of the GNU General Public 3 # License as published by the Free Software Foundation, version 2. 4 # 5 # This program is distributed in the hope that it will be useful, but WITHOUT 6 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 7 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 8 # details. 9 # 10 # You should have received a copy of the GNU General Public License along with 11 # this program; if not, write to the Free Software Foundation, Inc., 51 12 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 13 # 14 # Copyright Buildbot Team Members 15 16 from twisted.python import log 17 from twisted.internet import defer 18 from twisted.application import service 19 from buildbot.pbutil import NewCredPerspective 20 from buildbot.sourcestamp import SourceStamp 21 from buildbot import interfaces, config 22 from buildbot.process.properties import Properties259427 service.MultiService.__init__(self) 28 self.setName('debug_services') 29 self.master = master 30 31 self.debug_port = None 32 self.debug_password = None 33 self.debug_registration = None 34 self.manhole = None35 36 37 @defer.inlineCallbacks39 40 # debug client 41 config_changed = (self.debug_port != new_config.slavePortnum or 42 self.debug_password != new_config.debugPassword) 43 44 if not new_config.debugPassword or config_changed: 45 if self.debug_registration: 46 yield self.debug_registration.unregister() 47 self.debug_registration = None 48 49 if new_config.debugPassword and config_changed: 50 factory = lambda mind, user : DebugPerspective(self.master) 51 self.debug_registration = self.master.pbmanager.register( 52 new_config.slavePortnum, "debug", new_config.debugPassword, 53 factory) 54 55 self.debug_password = new_config.debugPassword 56 if self.debug_password: 57 self.debug_port = new_config.slavePortnum 58 else: 59 self.debug_port = None 60 61 # manhole 62 if new_config.manhole != self.manhole: 63 if self.manhole: 64 yield defer.maybeDeferred(lambda : 65 self.manhole.disownServiceParent()) 66 self.manhole.master = None 67 self.manhole = None 68 69 if new_config.manhole: 70 self.manhole = new_config.manhole 71 self.manhole.master = self.master 72 self.manhole.setServiceParent(self) 73 74 # chain up 75 yield config.ReconfigurableServiceMixin.reconfigService(self, 76 new_config)77 78 79 @defer.inlineCallbacks81 if self.debug_registration: 82 yield self.debug_registration.unregister() 83 self.debug_registration = None 84 85 # manhole will get stopped as a sub-service 86 87 yield defer.maybeDeferred(lambda : 88 service.MultiService.stopService(self)) 89 90 # clean up 91 if self.manhole: 92 self.manhole.master = None 93 self.manhole = None97 100 103 106137109 c = interfaces.IControl(self.master) 110 bc = c.getBuilder(buildername) 111 ss = SourceStamp(branch, revision) 112 bpr = Properties() 113 bpr.update(properties, "remote requestBuild") 114 return bc.submitBuildRequest(ss, reason, bpr)115 120 124126 log.msg("saying something on IRC") 127 from buildbot.status import words 128 for s in self.master: 129 if isinstance(s, words.IRC): 130 bot = s.f 131 for channel in bot.channels: 132 print " channel", channel 133 bot.p.msg(channel, "Ow, quit it")134136 log.msg("debug %s" % msg)
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Nov 21 16:22:58 2012 | http://epydoc.sourceforge.net |