[154414] contrib/buildbot-test/master.cfg
larryv at macports.org
larryv at macports.org
Sat Oct 29 02:52:48 CEST 2016
Revision: 154414
https://trac.macports.org/changeset/154414
Author: larryv at macports.org
Date: 2016-10-29 02:52:48 +0200 (Sat, 29 Oct 2016)
Log Message:
-----------
buildbot: Improve creation of buildslaves
- Don't create empty collections before populating them.
- Prefer list comprehension over `append`.
- Prefer lazy iteration.
Modified Paths:
--------------
contrib/buildbot-test/master.cfg
Modified: contrib/buildbot-test/master.cfg
===================================================================
--- contrib/buildbot-test/master.cfg 2016-10-29 00:50:08 UTC (rev 154413)
+++ contrib/buildbot-test/master.cfg 2016-10-29 00:52:48 UTC (rev 154414)
@@ -82,9 +82,6 @@
# a BuildSlave object, specifying a unique slave name and password. The same
# slave name and password must be configured on the slave.
-c['slaves'] = []
-slavedata = {}
-
with open(_path('slaves.json')) as f:
slavedata = json.load(f)
@@ -91,8 +88,8 @@
# convert unicode to byte strings
build_platforms = [s.encode('utf-8') for s in slavedata['build_platforms']]
-for slave, pwd in slavedata['slaves'].items():
- c['slaves'].append(buildslave.BuildSlave(slave, pwd))
+c['slaves'] = [buildslave.BuildSlave(name, pwd)
+ for name, pwd in slavedata['slaves'].iteritems()]
# 'slavePortnum' defines the TCP port to listen on for connections from slaves.
# This must match the value configured into the buildslaves (with their
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-changes/attachments/20161029/c1d38c83/attachment-0002.html>
More information about the macports-changes
mailing list