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

Side by Side Diff: scripts/slave/upload_goma_logs.py

Issue 2306523002: Avoid to use environment. (Closed)
Patch Set: rebase Created 4 years, 3 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 | « scripts/slave/recipes/win_analyze.expected/full_chromium_fyi_Chromium_Windows_Analyze.json ('k') | no next file » | 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 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
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',
58 help='buildbot buildername') 59 help='buildbot buildername')
59 parser.add_argument('--buildbot-mastername', 60 parser.add_argument('--buildbot-mastername',
61 default='unknown',
60 help='buildbot mastername') 62 help='buildbot mastername')
61 parser.add_argument('--buildbot-slavename', 63 parser.add_argument('--buildbot-slavename',
64 default='unknown',
62 help='buildbot slavename') 65 help='buildbot slavename')
63 parser.add_argument('--buildbot-clobber', 66 parser.add_argument('--buildbot-clobber',
64 help='buildbot clobber') 67 help='buildbot clobber')
65 68
66 args = parser.parse_args() 69 args = parser.parse_args()
67 70
68 # TODO(tikuta): Pass these variables explicitly. 71 # TODO(tikuta): Pass these variables explicitly.
69 if args.buildbot_buildername: 72 if args.buildbot_buildername:
70 os.environ['BUILDBOT_BUILDERNAME'] = args.buildbot_buildername 73 os.environ['BUILDBOT_BUILDERNAME'] = args.buildbot_buildername
71 if args.buildbot_mastername: 74 if args.buildbot_mastername:
(...skipping 15 matching lines...) Expand all
87 args.goma_crash_report_id_file, 90 args.goma_crash_report_id_file,
88 args.build_data_dir) 91 args.build_data_dir)
89 92
90 if not args.skip_sendgomatsmon: 93 if not args.skip_sendgomatsmon:
91 # In the case of goma_start is failed, 94 # In the case of goma_start is failed,
92 # we want log to investigate failed reason. 95 # we want log to investigate failed reason.
93 # So, let me send some logs instead of 96 # So, let me send some logs instead of
94 # error in parse_args() using required option. 97 # error in parse_args() using required option.
95 assert args.json_status is not None and os.path.exists(args.json_status) 98 assert args.json_status is not None and os.path.exists(args.json_status)
96 assert args.ninja_log_exit_status is not None 99 assert args.ninja_log_exit_status is not None
97 goma_utils.SendGomaTsMon(args.json_status, args.ninja_log_exit_status) 100 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)
98 105
99 return 0 106 return 0
100 107
101 108
102 if '__main__' == __name__: 109 if '__main__' == __name__:
103 sys.exit(main()) 110 sys.exit(main())
OLDNEW
« no previous file with comments | « scripts/slave/recipes/win_analyze.expected/full_chromium_fyi_Chromium_Windows_Analyze.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698