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

Side by Side Diff: scripts/tools/actions_parser.py

Issue 2084383003: Move 'buildbot.tac' and 'buildbot' files to a common directory. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Rebase Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « masters/state-template.txt ('k') | scripts/tools/buildbot_tool_templates/buildbot » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python2.7 1 #!/usr/bin/env python2.7
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 """Parses BuildBot `actions.log' and extracts events. 6 """Parses BuildBot `actions.log' and extracts events.
7 7
8 These events can be uploaded as JSON to monitoring endpoints. 8 These events can be uploaded as JSON to monitoring endpoints.
9 """ 9 """
10 10
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 raise PostFailedError('Unsuccessful HTTP response (%s)' % (r.status_code,)) 166 raise PostFailedError('Unsuccessful HTTP response (%s)' % (r.status_code,))
167 return 0 167 return 0
168 168
169 169
170 def get_master(checkout_root, name): 170 def get_master(checkout_root, name):
171 """Returns a Master instance for 'name', or None if one doesn't exist.""" 171 """Returns a Master instance for 'name', or None if one doesn't exist."""
172 # Prepend name with 'master.' if not specified. 172 # Prepend name with 'master.' if not specified.
173 if not name.startswith('master.'): 173 if not name.startswith('master.'):
174 name = 'master.%s' % (name,) 174 name = 'master.%s' % (name,)
175 175
176 # Identify masters as directories containing 'buildbot.tac' files. 176 # Identify masters as directories containing 'master.cfg' files.
177 glob_path = os.path.join(checkout_root, '*', 'masters', name, 'buildbot.tac') 177 glob_path = os.path.join(checkout_root, '*', 'masters', name, 'master.cfg')
178 for candidate in glob.iglob(glob_path): 178 for candidate in glob.iglob(glob_path):
179 return Master.fromdir(os.path.split(candidate)[0]) 179 return Master.fromdir(os.path.split(candidate)[0])
180 return None 180 return None
181 181
182 182
183 def get_all_masters(checkout_root): 183 def get_all_masters(checkout_root):
184 """Identifies all Master instances by probing a checkout root.""" 184 """Identifies all Master instances by probing a checkout root."""
185 masters = [] 185 masters = []
186 186
187 # Identify masters as directories containing 'buildbot.tac' files. 187 # Identify masters as directories containing 'master.cfg' files.
188 glob_path = os.path.join(checkout_root, '*', 'masters', '*', 'buildbot.tac') 188 glob_path = os.path.join(checkout_root, '*', 'masters', '*', 'master.cfg')
189 for candidate in glob.iglob(glob_path): 189 for candidate in glob.iglob(glob_path):
190 master = Master.fromdir(os.path.split(candidate)[0]) 190 master = Master.fromdir(os.path.split(candidate)[0])
191 191
192 # Discard this master if there is no 'actions.log' file. 192 # Discard this master if there is no 'actions.log' file.
193 if not os.path.exists(master.actions_log_path): 193 if not os.path.exists(master.actions_log_path):
194 logging.debug('Discarding master "%s": no "actions.log" available.', 194 logging.debug('Discarding master "%s": no "actions.log" available.',
195 master.name) 195 master.name)
196 continue 196 continue
197 masters.append(master) 197 masters.append(master)
198 return masters 198 return masters
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 296
297 if __name__ == '__main__': 297 if __name__ == '__main__':
298 logging.basicConfig(level=logging.WARNING) 298 logging.basicConfig(level=logging.WARNING)
299 return_code = 1 299 return_code = 1
300 try: 300 try:
301 return_code = main() 301 return_code = main()
302 except Exception: 302 except Exception:
303 logging.exception('Uncaught exception during execution') 303 logging.exception('Uncaught exception during execution')
304 finally: 304 finally:
305 sys.exit(return_code) 305 sys.exit(return_code)
OLDNEW
« no previous file with comments | « masters/state-template.txt ('k') | scripts/tools/buildbot_tool_templates/buildbot » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698