| OLD | NEW |
| 1 | 1 |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Returns the canonical version of bot setup scripts for hostname and image.""" | 6 """Returns the canonical version of bot setup scripts for hostname and image.""" |
| 7 | 7 |
| 8 | 8 |
| 9 LKGR = '87378f3474795c1426746bc5144e7459c2174b01' | 9 LKGR = '87378f3474795c1426746bc5144e7459c2174b01' |
| 10 DISABLED_BUILDERS = [ | 10 DISABLED_BUILDERS = [ |
| 11 'test_disabled_slave' | 11 'test_disabled_slave' |
| 12 ] | 12 ] |
| 13 | 13 |
| 14 CANARY_SLAVES = ( | 14 CANARY_SLAVES = ( |
| 15 ['swarm%d-c4' % i for i in xrange(1, 10)] + | 15 ['swarm%d-c4' % i for i in xrange(1, 10)] + |
| 16 ['slave%d-c4' % i for i in xrange(250, 260)]) | 16 ['slave%d-c4' % i for i in xrange(250, 260)] + |
| 17 ['winslave1-c4', 'swarm-win1-c4']) |
| 17 | 18 |
| 18 | 19 |
| 19 class BuilderDisabled(Exception): | 20 class BuilderDisabled(Exception): |
| 20 """This is raised when a builder should be disabled. | 21 """This is raised when a builder should be disabled. |
| 21 | 22 |
| 22 By raising an exception, the startup sequence becomes interrupted. | 23 By raising an exception, the startup sequence becomes interrupted. |
| 23 """ | 24 """ |
| 24 pass | 25 pass |
| 25 | 26 |
| 26 | 27 |
| 27 def get_version(slave_name=None, _image_name=None): | 28 def get_version(slave_name=None, _image_name=None): |
| 28 if slave_name and slave_name in DISABLED_BUILDERS: | 29 if slave_name and slave_name in DISABLED_BUILDERS: |
| 29 raise BuilderDisabled() | 30 raise BuilderDisabled() |
| 30 if not slave_name or slave_name in CANARY_SLAVES: | 31 if not slave_name or slave_name in CANARY_SLAVES: |
| 31 return 'origin/master' | 32 return 'origin/master' |
| 32 return LKGR | 33 return LKGR |
| OLD | NEW |