Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(473)

Unified Diff: scripts/tools/botmap.py

Issue 12300004: Build scripts refactor to support multislave (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: rebase Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « scripts/slave/slave_utils.py ('k') | slave/run_slave.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/tools/botmap.py
diff --git a/scripts/tools/botmap.py b/scripts/tools/botmap.py
index 99c6bb3073d640a9a4035998f8ab22c66d0d2011..47f3b7c9bf34d70a41900090f88e1c748f00eb56 100755
--- a/scripts/tools/botmap.py
+++ b/scripts/tools/botmap.py
@@ -13,28 +13,19 @@ from common import chromium_utils
def main():
- slaves = []
- for master in chromium_utils.ListMasters(cue='slaves.cfg'):
- masterbase = os.path.basename(master)
- master_slaves = {}
- execfile(os.path.join(master, 'slaves.cfg'), master_slaves)
- for slave in master_slaves.get('slaves', []):
- slave['master'] = masterbase
- slaves.extend(master_slaves.get('slaves', []))
- for slave in sorted(slaves, cmp=None, key=lambda x : x.get('hostname', '')):
- slavename = slave.get('hostname')
- if not slavename:
- continue
- master = slave.get('master', '?')
- builder = slave.get('builder', '?')
- if builder == []:
- builder = '?'
- osname = slave.get('os', '?')
- if type(builder) is list:
- for b in sorted(builder):
- print '%-30s %-35s %-35s %-10s' % (slavename, master, b, osname)
- else:
- print '%-30s %-35s %-35s %-10s' % (slavename, master, builder, osname)
+ # remove slaves with blank or no hostname
+ slaves = filter(lambda x: x.get('hostname'), chromium_utils.GetAllSlaves())
+ slaves.sort(key=lambda x: (x.get('mastername'), x['hostname']))
+ for slave in slaves:
+ builder = slave.get('builder') or '?'
+ if type(builder) is not list:
+ builder = [builder]
+ for b in sorted(builder):
+ print '%-30s %-35s %-35s %-10s' % (
+ slave['hostname'],
+ slave.get('mastername', '?'),
+ b,
+ slave.get('os', '?'))
if __name__ == '__main__':
« no previous file with comments | « scripts/slave/slave_utils.py ('k') | slave/run_slave.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698