Merge "Register connections when testing configuration"

This commit is contained in:
Jenkins 2016-07-12 23:05:59 +00:00 committed by Gerrit Code Review
commit d616541288
2 changed files with 6 additions and 2 deletions

View File

@ -89,6 +89,7 @@ class Server(zuul.cmd.ZuulApp):
self.sched = zuul.scheduler.Scheduler(self.config,
testonly=True)
self.configure_connections()
self.sched.registerConnections(self.connections, load=False)
layout = self.sched.testConfig(self.config.get('zuul',
'layout_config'),
self.connections)

View File

@ -316,11 +316,14 @@ class Scheduler(threading.Thread):
# Any skip-if predicate can be matched to trigger a skip
return cm.MatchAny(skip_matchers)
def registerConnections(self, connections):
def registerConnections(self, connections, load=True):
# load: whether or not to trigger the onLoad for the connection. This
# is useful for not doing a full load during layout validation.
self.connections = connections
for connection_name, connection in self.connections.items():
connection.registerScheduler(self)
connection.onLoad()
if load:
connection.onLoad()
def stopConnections(self):
for connection_name, connection in self.connections.items():