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

Unified Diff: scripts/slave/gatekeeper_ng_config.py

Issue 172523005: Keep track of hashes triggered instead of builds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Now uses a NamedTuple build_db. Created 6 years, 10 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
Index: scripts/slave/gatekeeper_ng_config.py
diff --git a/scripts/slave/gatekeeper_ng_config.py b/scripts/slave/gatekeeper_ng_config.py
index adb895ca4173f24eb2faadeabdcce797ee36f243..f7316ca589c0ff09c708a7b3f702a03b5474b99f 100755
--- a/scripts/slave/gatekeeper_ng_config.py
+++ b/scripts/slave/gatekeeper_ng_config.py
@@ -247,15 +247,16 @@ def inject_hashes(gatekeeper_config):
return new_config
-def flatten_to_json(gatekeeper_config, stream):
- # Python's sets aren't JSON-encodable, so we convert them to lists here.
- class SetEncoder(json.JSONEncoder):
- # pylint: disable=E0202
- def default(self, obj):
- if isinstance(obj, set):
- return sorted(list(obj))
- return json.JSONEncoder.default(self, obj)
+# Python's sets aren't JSON-encodable, so we convert them to lists here.
+class SetEncoder(json.JSONEncoder):
+ # pylint: disable=E0202
+ def default(self, obj):
+ if isinstance(obj, set):
+ return sorted(list(obj))
+ return json.JSONEncoder.default(self, obj)
+
+def flatten_to_json(gatekeeper_config, stream):
json.dump(gatekeeper_config, stream, cls=SetEncoder, sort_keys=True)

Powered by Google App Engine
This is Rietveld 408576698