| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 import collections | 7 import collections |
| 8 import copy | 8 import copy |
| 9 import json | 9 import json |
| 10 import os | 10 import os |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 hostname_stdout, hostname_stderr = proc.communicate() | 278 hostname_stdout, hostname_stderr = proc.communicate() |
| 279 if proc.returncode == 0: | 279 if proc.returncode == 0: |
| 280 print 'Running on: ' + hostname_stdout | 280 print 'Running on: ' + hostname_stdout |
| 281 else: | 281 else: |
| 282 print >> sys.stderr, 'WARNING: failed to run hostname' | 282 print >> sys.stderr, 'WARNING: failed to run hostname' |
| 283 print >> sys.stderr, hostname_stdout | 283 print >> sys.stderr, hostname_stdout |
| 284 print >> sys.stderr, hostname_stderr | 284 print >> sys.stderr, hostname_stderr |
| 285 sys.exit(1) | 285 sys.exit(1) |
| 286 | 286 |
| 287 # TODO(phajdan.jr): Remove hack for http://crbug.com/378779 . | 287 # TODO(phajdan.jr): Remove hack for http://crbug.com/378779 . |
| 288 if hostname_stdout == 'build1-a1.perf.chromium.org': | 288 if (hostname_stdout == 'build1-a1.perf.chromium.org' or |
| 289 os.path.exists('/b/build/slave/Android_Builder__dbg_')): |
| 289 if os.path.exists('/b/build/slave/Android_Builder__dbg_378779'): | 290 if os.path.exists('/b/build/slave/Android_Builder__dbg_378779'): |
| 290 print '/b/build/slave/Android_Builder__dbg_378779 exists, skipping' | 291 print '/b/build/slave/Android_Builder__dbg_378779 exists, skipping' |
| 291 else: | 292 else: |
| 292 print 'CLEANING UP CHECKOUT DIRECTORY HACK SEE http://crbug.com/378779' | 293 print 'CLEANING UP CHECKOUT DIRECTORY HACK SEE http://crbug.com/378779' |
| 293 os.rename('/b/build/slave/Android_Builder__dbg_', | 294 os.rename('/b/build/slave/Android_Builder__dbg_', |
| 294 '/b/build/slave/Android_Builder__dbg_378779') | 295 '/b/build/slave/Android_Builder__dbg_378779') |
| 295 | 296 |
| 296 parser = GetRunBotOptParser() | 297 parser = GetRunBotOptParser() |
| 297 options, args = parser.parse_args(argv[1:]) | 298 options, args = parser.parse_args(argv[1:]) |
| 298 if args: | 299 if args: |
| 299 parser.error('Unused args: %s' % args) | 300 parser.error('Unused args: %s' % args) |
| 300 | 301 |
| 301 bot_config = GetBotConfig(options, GetBotStepMap()) | 302 bot_config = GetBotConfig(options, GetBotStepMap()) |
| 302 if not bot_config: | 303 if not bot_config: |
| 303 sys.exit(1) | 304 sys.exit(1) |
| 304 | 305 |
| 305 print 'Using config:', bot_config | 306 print 'Using config:', bot_config |
| 306 | 307 |
| 307 commands = GetCommands(options, bot_config) | 308 commands = GetCommands(options, bot_config) |
| 308 for command in commands: | 309 for command in commands: |
| 309 print 'Will run: ', bb_utils.CommandToString(command) | 310 print 'Will run: ', bb_utils.CommandToString(command) |
| 310 print | 311 print |
| 311 | 312 |
| 312 env = GetEnvironment(bot_config.host_obj, options.testing) | 313 env = GetEnvironment(bot_config.host_obj, options.testing) |
| 313 return RunBotCommands(options, commands, env) | 314 return RunBotCommands(options, commands, env) |
| 314 | 315 |
| 315 | 316 |
| 316 if __name__ == '__main__': | 317 if __name__ == '__main__': |
| 317 sys.exit(main(sys.argv)) | 318 sys.exit(main(sys.argv)) |
| OLD | NEW |