Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 import logging | |
| 6 import sys | |
| 7 | |
| 8 from collections import OrderedDict, namedtuple | |
|
smut
2015/04/10 21:17:17
import collections (and group with logging, sys)
dnj
2015/04/10 21:42:45
Done.
| |
| 9 | |
| 10 from common.slave_alloc import SlaveAllocator | |
| 11 from common.cros_chromite import Get, ChromiteTarget | |
| 12 from master.cros import builder_config | |
| 13 | |
| 14 | |
| 15 __all__ = [ | |
| 16 'builder_configs', | |
| 17 'slave_allocator', | |
| 18 ] | |
| 19 | |
| 20 | |
| 21 # Declare a slave allocator. We do this here so we can access the slaves | |
| 22 # configured by 'slaves.cfg' in 'master.cfg'. | |
| 23 slave_allocator = SlaveAllocator() | |
| 24 | |
| 25 | |
| 26 # Get the pinned Chromite configuration. | |
| 27 cbb_config = Get(allow_fetch=True) | |
| 28 | |
| 29 | |
| 30 # Select any board that is configured to build on this waterfall. | |
| 31 def _GetWaterfallTargets(): | |
| 32 result = OrderedDict() | |
| 33 for config in cbb_config.itervalues(): | |
| 34 if config.get('active_waterfall') != 'chromiumos': | |
| 35 continue | |
| 36 result[config.name] = config | |
| 37 return result | |
| 38 waterfall_targets = _GetWaterfallTargets() | |
| 39 | |
| 40 | |
| 41 # Load the builder configs. | |
| 42 builder_configs = builder_config.GetBuilderConfigs(waterfall_targets) | |
| 43 builder_name_map = dict((c.builder_name, c) | |
| 44 for c in builder_configs.itervalues()) | |
| OLD | NEW |