OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 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 """Wrapper for adding logdog streaming support to swarming tasks.""" | 6 """Wrapper for adding logdog streaming support to swarming tasks.""" |
7 | 7 |
8 import argparse | 8 import argparse |
9 import logging | 9 import logging |
10 import os | 10 import os |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 args.prefix = args.prefix.replace('${SWARMING_TASK_ID}', | 50 args.prefix = args.prefix.replace('${SWARMING_TASK_ID}', |
51 os.environ.get('SWARMING_TASK_ID')) | 51 os.environ.get('SWARMING_TASK_ID')) |
52 url = CreateUrl('luci-logdog.appspot.com', args.project, args.prefix, | 52 url = CreateUrl('luci-logdog.appspot.com', args.project, args.prefix, |
53 args.name) | 53 args.name) |
54 logdog_cmd = [args.logdog_bin_cmd, '-project', args.project, | 54 logdog_cmd = [args.logdog_bin_cmd, '-project', args.project, |
55 '-output', 'logdog,host=%s' % args.logdog_server, | 55 '-output', 'logdog,host=%s' % args.logdog_server, |
56 '-prefix', args.prefix, | 56 '-prefix', args.prefix, |
57 '-service-account-json', args.service_account_json, | 57 '-service-account-json', args.service_account_json, |
58 'stream', '-source', args.source, | 58 'stream', '-source', args.source, |
59 '-stream', '-name=%s' % args.name] | 59 '-stream', '-name=%s' % args.name] |
60 subprocess.call(logdog_cmd) | 60 if os.path.exists(args.logdog_bin_cmd): |
dnj
2016/08/12 19:29:02
Does this mean that if binary doesn't exist, nothi
dnj
2016/08/12 19:34:57
I guess what I'm saying is:
1) We're explicitly ma
dnj
2016/08/12 19:49:01
Maybe the thing to do here is surround the engire
| |
61 logging.info('Logcats are located at: %s', url) | 61 subprocess.call(logdog_cmd) |
62 logging.info('Logcats are located at: %s', url) | |
62 return result | 63 return result |
63 | 64 |
64 | 65 |
65 if __name__ == '__main__': | 66 if __name__ == '__main__': |
66 sys.exit(main()) | 67 sys.exit(main()) |
OLD | NEW |