Merge "Register connections when testing configuration"
This commit is contained in:
commit
d616541288
|
@ -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)
|
||||
|
|
|
@ -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():
|
||||
|
|
Loading…
Reference in New Issue