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

Side by Side Diff: scripts/slave/skia/slaves_cfg.py

Issue 1128823007: Skia recipes: Move Android and ChromeOS config info in from slaves.cfg (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5
6 """Utilities for working with slaves.cfg files."""
7
8
9 import os
10
11
12 def _slaves_cfg_path(master_name):
13 def _make_path(master_name, build_dir):
14 return os.path.abspath(os.path.join(
15 os.path.abspath(os.path.dirname(__file__)), os.pardir, os.pardir,
16 os.pardir, os.pardir, build_dir, 'masters',
17 'master.' + master_name, 'slaves.cfg'))
18 path = _make_path(master_name, 'build')
19 if os.path.isfile(path):
20 return path
21 path = _make_path(master_name, 'build_internal')
22 if os.path.isfile(path):
23 return path
24 return None
25
26
27 def get(master_name):
28 """Return a dictionary of the buildslaves for the given master.
29
30 Keys are slavenames and values are the unmodified slave dicts from the
31 slaves.cfg file for the given master.
32 """
33 variables = {}
34 execfile(_slaves_cfg_path(master_name), variables)
35 slaves_cfg = {}
36 for slave_dict in variables['slaves']:
37 slaves_cfg[slave_dict['hostname']] = slave_dict
38 return slaves_cfg
39
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698