OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 """Access the commit queue from the command line. | 6 """Access the commit queue from the command line. |
7 """ | 7 """ |
8 | 8 |
9 __version__ = '0.1' | 9 __version__ = '0.1' |
10 | 10 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 135 |
136 config = cq_pb2.Config() | 136 config = cq_pb2.Config() |
137 text_format.Merge(cq_config, config) | 137 text_format.Merge(cq_config, config) |
138 masters = {} | 138 masters = {} |
139 if config.HasField('verifiers') and config.verifiers.HasField('try_job'): | 139 if config.HasField('verifiers') and config.verifiers.HasField('try_job'): |
140 for bucket in config.verifiers.try_job.buckets: | 140 for bucket in config.verifiers.try_job.buckets: |
141 masters.setdefault(bucket.name, {}) | 141 masters.setdefault(bucket.name, {}) |
142 for builder in bucket.builders: | 142 for builder in bucket.builders: |
143 if not builder.HasField('experiment_percentage'): | 143 if not builder.HasField('experiment_percentage'): |
144 masters[bucket.name].setdefault(builder.name, {}) | 144 masters[bucket.name].setdefault(builder.name, {}) |
145 for prop in builder.properties: | |
146 masters[bucket.name][builder.name][prop.name] = prop.value | |
147 print json.dumps(masters) | 145 print json.dumps(masters) |
148 | 146 |
149 CMDbuilders.func_usage_more = '<path-to-cq-config>' | 147 CMDbuilders.func_usage_more = '<path-to-cq-config>' |
150 | 148 |
151 ############################################################################### | 149 ############################################################################### |
152 ## Boilerplate code | 150 ## Boilerplate code |
153 | 151 |
154 | 152 |
155 class OptionParser(optparse.OptionParser): | 153 class OptionParser(optparse.OptionParser): |
156 """An OptionParser instance with default options. | 154 """An OptionParser instance with default options. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 return CMDhelp(parser, args) | 226 return CMDhelp(parser, args) |
229 | 227 |
230 | 228 |
231 if __name__ == "__main__": | 229 if __name__ == "__main__": |
232 fix_encoding.fix_encoding() | 230 fix_encoding.fix_encoding() |
233 try: | 231 try: |
234 sys.exit(main()) | 232 sys.exit(main()) |
235 except KeyboardInterrupt: | 233 except KeyboardInterrupt: |
236 sys.stderr.write('interrupted\n') | 234 sys.stderr.write('interrupted\n') |
237 sys.exit(1) | 235 sys.exit(1) |
OLD | NEW |