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

Unified Diff: scripts/common/slave_alloc.py

Issue 2250443002: Update floating builder logic, add to "chromiumos" (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Pylint fixes. Created 4 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « masters/master.chromiumos/slaves.cfg ('k') | scripts/master/cros/builder_config.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/common/slave_alloc.py
diff --git a/scripts/common/slave_alloc.py b/scripts/common/slave_alloc.py
index a2f830e67ed3975991c356f3ecb17a51923b7383..3870606a798582546758dc5440ffbcc319b3898d 100644
--- a/scripts/common/slave_alloc.py
+++ b/scripts/common/slave_alloc.py
@@ -156,7 +156,7 @@ class SlaveAllocator(object):
subtype_dict.extend(slave_list)
if self._list_unallocated:
- state_dict['unallocated'] = list(self._state.unallocated or ())
+ state_dict['unallocated'] = sorted(list(self._state.unallocated or ()))
with open(self.state_path, 'w') as fd:
json.dump(state_dict, fd, sort_keys=True, indent=2)
@@ -346,3 +346,12 @@ class SlaveAllocator(object):
classes=frozenset(v.classes),
keys=tuple(sorted(v.keys)))
return result
+
+
+def BuildClassMap(sm):
+ class_map = {}
+ for s, e in sm.entries.iteritems():
+ for cls in e.classes:
+ subtype_map = class_map.setdefault(cls.name, {})
+ subtype_map.setdefault(cls.subtype, set()).add(s)
+ return class_map
« no previous file with comments | « masters/master.chromiumos/slaves.cfg ('k') | scripts/master/cros/builder_config.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698