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

Side by Side Diff: scripts/master/master_utils.py

Issue 2454643002: Fix return value of new slave-distribution function (Closed)
Patch Set: Fix Created 4 years, 1 month 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
« no previous file with comments | « no previous file | scripts/master/unittests/master_utils_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 os 6 import os
7 import random 7 import random
8 import re 8 import re
9 import sys 9 import sys
10 10
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 elif None in prefs: 698 elif None in prefs:
699 # Second choice: Slaves that don't prefer any builders. 699 # Second choice: Slaves that don't prefer any builders.
700 key = None 700 key = None
701 else: 701 else:
702 # Third choice: Slaves that prefer other builders but have largest 702 # Third choice: Slaves that prefer other builders but have largest
703 # capacity left. If several groups of slaves with equal capacity exist, 703 # capacity left. If several groups of slaves with equal capacity exist,
704 # one group will be chosen arbitrarily, the actual slave will be chosen 704 # one group will be chosen arbitrarily, the actual slave will be chosen
705 # randomly. 705 # randomly.
706 key = prefs.most_common()[0][0] 706 key = prefs.most_common()[0][0]
707 return self._choice( 707 return self._choice(
708 s for s in slave_builders 708 [s for s in slave_builders
709 if s.slave.properties.getProperty('preferred_builder') == key) 709 if s.slave.properties.getProperty('preferred_builder') == key])
710 710
711 711
712 def SetMasterProcessName(): 712 def SetMasterProcessName():
713 """Sets the name of this process to the name of the master. Linux only.""" 713 """Sets the name of this process to the name of the master. Linux only."""
714 714
715 if sys.platform != 'linux2': 715 if sys.platform != 'linux2':
716 return 716 return
717 717
718 command_line.set_command_line("master: %s" % GetMastername()) 718 command_line.set_command_line("master: %s" % GetMastername())
OLDNEW
« no previous file with comments | « no previous file | scripts/master/unittests/master_utils_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698