OLD | NEW |
(Empty) | |
| 1 # Copyright (c) 2011 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 """Implement builder selection for CrOS.""" |
| 6 |
| 7 from master.builders_pools import BuildersPools |
| 8 |
| 9 class CrOSBuildersPools(BuildersPools): |
| 10 """Adds support for builder config->name mappings.""" |
| 11 |
| 12 def __init__(self, default_pool_name, builder_mapping, parent=None): |
| 13 BuildersPools.__init__(self, default_pool_name, parent) |
| 14 self._builder_mapping = builder_mapping |
| 15 |
| 16 def Select(self, builder_names=None, pool_name=None): |
| 17 """Returns list of selected builder names. |
| 18 |
| 19 Args: |
| 20 builder_names: A list of CrOS build configurations (i.e., |
| 21 x86-generic-pre-flight-queue) to select. |
| 22 pool_name: The builder pool to look in. |
| 23 |
| 24 Returns: |
| 25 A list of buildbot builder names. |
| 26 """ |
| 27 # If the user has requested specific build configurations, return the |
| 28 # corresponding builder names. |
| 29 if builder_names: |
| 30 return [self._builder_mapping.get(name) for name in builder_names] |
| 31 else: |
| 32 return BuildersPools.Select(self, None, pool_name) |
OLD | NEW |