OLD | NEW |
1 # Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import collections | 5 import collections |
6 import logging | 6 import logging |
7 import sys | 7 import sys |
8 | 8 |
| 9 from common.cros_chromite import Get, ChromiteTarget |
9 from common.slave_alloc import SlaveAllocator | 10 from common.slave_alloc import SlaveAllocator |
10 from common.cros_chromite import Get, ChromiteTarget | |
11 from master.cros import builder_config | 11 from master.cros import builder_config |
12 | 12 |
13 | 13 |
14 # Declare a slave allocator. We do this here so we can access the slaves | 14 # Declare a slave allocator. We do this here so we can access the slaves |
15 # configured by 'slaves.cfg' in 'master.cfg'. | 15 # configured by 'slaves.cfg' in 'master.cfg'. |
16 slave_allocator = SlaveAllocator() | 16 slave_allocator = SlaveAllocator() |
17 | 17 |
18 | 18 |
19 # Get the pinned Chromite configuration. | 19 # Get the pinned Chromite configuration. |
20 cbb_config = Get(allow_fetch=True) | 20 cbb_config = Get(allow_fetch=True) |
21 | 21 |
22 | 22 |
23 # Select any board that is configured to build on this waterfall. | 23 # Select any board that is configured to build on this waterfall. |
24 def _GetWaterfallTargets(): | 24 def _GetWaterfallTargets(): |
25 result = collections.OrderedDict() | 25 result = collections.OrderedDict() |
26 for config in cbb_config.itervalues(): | 26 for config in cbb_config.itervalues(): |
27 if config.get('active_waterfall') != 'chromiumos': | 27 if config.get('active_waterfall') != 'chromiumos': |
28 continue | 28 continue |
29 result[config.name] = config | 29 result[config.name] = config |
30 return result | 30 return result |
31 waterfall_targets = _GetWaterfallTargets() | 31 waterfall_targets = _GetWaterfallTargets() |
32 | 32 |
33 | 33 |
34 # Load the builder configs. | 34 # Load the builder configs. |
35 builder_configs = builder_config.GetBuilderConfigs(waterfall_targets) | 35 builder_configs = builder_config.GetBuilderConfigs(waterfall_targets) |
36 builder_name_map = dict((c.builder_name, c) | 36 builder_name_map = dict((c.builder_name, c) |
37 for c in builder_configs.itervalues()) | 37 for c in builder_configs.itervalues()) |
OLD | NEW |