| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2015 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2015 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 """upload goma related logs.""" | 6 """upload goma related logs.""" |
| 7 | 7 |
| 8 import argparse | 8 import argparse |
| 9 import os | 9 import os |
| 10 import sys | 10 import sys |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 help='path of json file generated from' | 48 help='path of json file generated from' |
| 49 ' ./goma_ctl.py jsonstatus') | 49 ' ./goma_ctl.py jsonstatus') |
| 50 parser.add_argument('--skip-sendgomatsmon', action='store_true', | 50 parser.add_argument('--skip-sendgomatsmon', action='store_true', |
| 51 help='Represent whether send jsonstatus' | 51 help='Represent whether send jsonstatus' |
| 52 ' and exit_status log to TsMon.' | 52 ' and exit_status log to TsMon.' |
| 53 ' This option is only allowed to used when' | 53 ' This option is only allowed to used when' |
| 54 ' start() of recipe_modules/goma failes.') | 54 ' start() of recipe_modules/goma failes.') |
| 55 | 55 |
| 56 # Arguments set to os.environ | 56 # Arguments set to os.environ |
| 57 parser.add_argument('--buildbot-buildername', | 57 parser.add_argument('--buildbot-buildername', |
| 58 default='unknown', | |
| 59 help='buildbot buildername') | 58 help='buildbot buildername') |
| 60 parser.add_argument('--buildbot-mastername', | 59 parser.add_argument('--buildbot-mastername', |
| 61 default='unknown', | |
| 62 help='buildbot mastername') | 60 help='buildbot mastername') |
| 63 parser.add_argument('--buildbot-slavename', | 61 parser.add_argument('--buildbot-slavename', |
| 64 default='unknown', | |
| 65 help='buildbot slavename') | 62 help='buildbot slavename') |
| 66 parser.add_argument('--buildbot-clobber', | 63 parser.add_argument('--buildbot-clobber', |
| 67 help='buildbot clobber') | 64 help='buildbot clobber') |
| 68 | 65 |
| 69 args = parser.parse_args() | 66 args = parser.parse_args() |
| 70 | 67 |
| 71 # TODO(tikuta): Pass these variables explicitly. | 68 # TODO(tikuta): Pass these variables explicitly. |
| 72 if args.buildbot_buildername: | 69 if args.buildbot_buildername: |
| 73 os.environ['BUILDBOT_BUILDERNAME'] = args.buildbot_buildername | 70 os.environ['BUILDBOT_BUILDERNAME'] = args.buildbot_buildername |
| 74 if args.buildbot_mastername: | 71 if args.buildbot_mastername: |
| (...skipping 15 matching lines...) Expand all Loading... |
| 90 args.goma_crash_report_id_file, | 87 args.goma_crash_report_id_file, |
| 91 args.build_data_dir) | 88 args.build_data_dir) |
| 92 | 89 |
| 93 if not args.skip_sendgomatsmon: | 90 if not args.skip_sendgomatsmon: |
| 94 # In the case of goma_start is failed, | 91 # In the case of goma_start is failed, |
| 95 # we want log to investigate failed reason. | 92 # we want log to investigate failed reason. |
| 96 # So, let me send some logs instead of | 93 # So, let me send some logs instead of |
| 97 # error in parse_args() using required option. | 94 # error in parse_args() using required option. |
| 98 assert args.json_status is not None and os.path.exists(args.json_status) | 95 assert args.json_status is not None and os.path.exists(args.json_status) |
| 99 assert args.ninja_log_exit_status is not None | 96 assert args.ninja_log_exit_status is not None |
| 100 goma_utils.SendGomaTsMon(args.json_status, args.ninja_log_exit_status, | 97 goma_utils.SendGomaTsMon(args.json_status, args.ninja_log_exit_status) |
| 101 builder=args.buildbot_buildername, | |
| 102 master=args.buildbot_mastername, | |
| 103 slave=args.buildbot_slavename, | |
| 104 clobber=args.buildbot_clobber) | |
| 105 | 98 |
| 106 return 0 | 99 return 0 |
| 107 | 100 |
| 108 | 101 |
| 109 if '__main__' == __name__: | 102 if '__main__' == __name__: |
| 110 sys.exit(main()) | 103 sys.exit(main()) |
| OLD | NEW |