Hashar has uploaded a new change for review.
https://gerrit.wikimedia.org/r/299542
Change subject: Register connections when testing configuration
......................................................................
Register connections when testing configuration
The layout validation requires the connections to be registered
with the scheduler to know what connection names are valid in the
layout.yaml.
However avoid starting the connections so that things like the
gerrit connection don't start streaming from gerrit yet.
Change-Id: Ie9a03287835c6966f5ac32cac020cf2642ce27d5
---
M zuul/cmd/server.py
M zuul/scheduler.py
2 files changed, 6 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/integration/zuul
refs/changes/42/299542/1
diff --git a/zuul/cmd/server.py b/zuul/cmd/server.py
index 8861972..e713a52 100755
--- a/zuul/cmd/server.py
+++ b/zuul/cmd/server.py
@@ -88,6 +88,7 @@
logging.basicConfig(level=logging.DEBUG)
self.sched = zuul.scheduler.Scheduler(self.config)
self.configure_connections()
+ self.sched.registerConnections(self.connections, load=False)
layout = self.sched.testConfig(self.config.get('zuul',
'layout_config'),
self.connections)
diff --git a/zuul/scheduler.py b/zuul/scheduler.py
index aea9a67..b631344 100644
--- a/zuul/scheduler.py
+++ b/zuul/scheduler.py
@@ -313,11 +313,14 @@
# 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():
--
To view, visit https://gerrit.wikimedia.org/r/299542
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie9a03287835c6966f5ac32cac020cf2642ce27d5
Gerrit-PatchSet: 1
Gerrit-Project: integration/zuul
Gerrit-Branch: patch-queue/debian/precise-wikimedia
Gerrit-Owner: Hashar <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits