Package buildbot :: Package process :: Package users :: Module manager
[frames] | no frames]

Source Code for Module buildbot.process.users.manager

 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.internet import defer 
17  from twisted.application import service 
18  from buildbot import config 
19 20 -class UserManagerManager(config.ReconfigurableServiceMixin, 21 service.MultiService):
22 # this class manages a fleet of user managers; hence the name.. 23
24 - def __init__(self, master):
25 service.MultiService.__init__(self) 26 self.setName('user_manager_manager') 27 self.master = master
28 29 @defer.deferredGenerator
30 - def reconfigService(self, new_config):
31 # this is easy - kick out all of the old managers, and add the 32 # new ones. 33 34 for mgr in list(self): 35 wfd = defer.waitForDeferred( 36 defer.maybeDeferred(lambda : 37 mgr.disownServiceParent())) 38 yield wfd 39 wfd.getResult() 40 mgr.master = None 41 42 for mgr in new_config.user_managers: 43 mgr.master = self.master 44 mgr.setServiceParent(self) 45 46 # reconfig any newly-added change sources, as well as existing 47 wfd = defer.waitForDeferred( 48 config.ReconfigurableServiceMixin.reconfigService(self, 49 new_config)) 50 yield wfd 51 wfd.getResult()
52