Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2016 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 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 import argparse | 6 import argparse |
| 7 import errno | 7 import errno |
| 8 import os | 8 import os |
| 9 import signal | 9 import signal |
| 10 import subprocess | 10 import subprocess |
| 11 import sys | 11 import sys |
| 12 | 12 |
| 13 from slave import goma_utils | 13 from slave import goma_utils |
| 14 | 14 |
| 15 | 15 |
| 16 def start_cloudtail(args): | 16 def start_cloudtail(args): |
| 17 """Write process id of started cloudtail to file object f""" | 17 """Write process id of started cloudtail to file object f""" |
| 18 | 18 |
| 19 proc = subprocess.Popen([args.cloudtail_path, | 19 proc = subprocess.Popen([args.cloudtail_path, |
| 20 'tail', | 20 'tail', |
| 21 '--log-id', 'goma_compiler_proxy', | 21 '--log-id', 'goma_compiler_proxy', |
| 22 '--path', | 22 '--path', |
| 23 goma_utils.GetLatestGomaCompilerProxyInfo()]) | 23 goma_utils.GetLatestGomaCompilerProxyInfo()], |
| 24 close_fds=True) | |
|
shinyak (Google)
2016/09/27 09:05:18
align indent?
tikuta
2016/09/27 09:06:46
above lines are in array.
it is correct indent.
shinyak (Google)
2016/09/27 09:10:54
mmm...
ukai
2016/09/28 02:21:24
might be better to set stdout (and maybe stderr) t
tikuta
2016/09/28 02:27:14
Done.
| |
| 24 | 25 |
| 25 sys.stdout.write(str(proc.pid)) | 26 sys.stdout.write(str(proc.pid)) |
| 26 | 27 |
| 27 | 28 |
| 28 def main(): | 29 def main(): |
| 29 parser = argparse.ArgumentParser( | 30 parser = argparse.ArgumentParser( |
| 30 description='cloudtail utility for goma recipe module.') | 31 description='cloudtail utility for goma recipe module.') |
| 31 | 32 |
| 32 subparsers = parser.add_subparsers(help='commands for cloudtail') | 33 subparsers = parser.add_subparsers(help='commands for cloudtail') |
| 33 | 34 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 51 try: | 52 try: |
| 52 os.kill(args.killed_pid, signal.SIGKILL) | 53 os.kill(args.killed_pid, signal.SIGKILL) |
| 53 except OSError as e: | 54 except OSError as e: |
| 54 if e.errno != errno.ESRCH: | 55 if e.errno != errno.ESRCH: |
| 55 # TODO(tikuta): Resolve https://crbug.com/639910. | 56 # TODO(tikuta): Resolve https://crbug.com/639910. |
| 56 raise | 57 raise |
| 57 | 58 |
| 58 | 59 |
| 59 if '__main__' == __name__: | 60 if '__main__' == __name__: |
| 60 sys.exit(main()) | 61 sys.exit(main()) |
| OLD | NEW |