| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The LUCI Authors. All rights reserved. | 2 # Copyright 2014 The LUCI Authors. All rights reserved. |
| 3 # Use of this source code is governed under the Apache License, Version 2.0 | 3 # Use of this source code is governed under the Apache License, Version 2.0 |
| 4 # that can be found in the LICENSE file. | 4 # that can be found in the LICENSE file. |
| 5 | 5 |
| 6 """Automated maintenance tool to run a script on bots. | 6 """Automated maintenance tool to run a script on bots. |
| 7 | 7 |
| 8 To use this script, write a self-contained python script (use a .zip if | 8 To use this script, write a self-contained python script (use a .zip if |
| 9 necessary), specify it on the command line and it will be packaged and triggered | 9 necessary), specify it on the command line and it will be packaged and triggered |
| 10 on all the swarming bots corresponding to the --dimension filters specified, or | 10 on all the swarming bots corresponding to the --dimension filters specified, or |
| 11 all the bots if no filter is specified. | 11 all the bots if no filter is specified. |
| 12 """ | 12 """ |
| 13 | 13 |
| 14 __version__ = '0.1' | 14 __version__ = '0.1' |
| 15 | 15 |
| 16 import os | 16 import os |
| 17 import tempfile | 17 import tempfile |
| 18 import shutil | 18 import shutil |
| 19 import subprocess | 19 import subprocess |
| 20 import sys | 20 import sys |
| 21 | 21 |
| 22 ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | 22 ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath( |
| 23 __file__.decode(sys.getfilesystemencoding())))) |
| 23 | 24 |
| 24 # Must be first import. | 25 # Must be first import. |
| 25 import parallel_execution | 26 import parallel_execution |
| 26 | 27 |
| 27 from third_party import colorama | 28 from third_party import colorama |
| 28 from third_party.depot_tools import fix_encoding | 29 from third_party.depot_tools import fix_encoding |
| 29 from utils import file_path | 30 from utils import file_path |
| 30 from utils import tools | 31 from utils import tools |
| 31 | 32 |
| 32 | 33 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 isolated_hash, | 182 isolated_hash, |
| 182 name, | 183 name, |
| 183 bots) | 184 bots) |
| 184 | 185 |
| 185 | 186 |
| 186 if __name__ == '__main__': | 187 if __name__ == '__main__': |
| 187 fix_encoding.fix_encoding() | 188 fix_encoding.fix_encoding() |
| 188 tools.disable_buffering() | 189 tools.disable_buffering() |
| 189 colorama.init() | 190 colorama.init() |
| 190 sys.exit(main()) | 191 sys.exit(main()) |
| OLD | NEW |