| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 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 # TODO(hinoka): Use logging. | 6 # TODO(hinoka): Use logging. |
| 7 | 7 |
| 8 import cStringIO | 8 import cStringIO |
| 9 import codecs | 9 import codecs |
| 10 import collections | 10 import collections |
| (...skipping 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1691 print ACTIVATED_MESSAGE if active else NOT_ACTIVATED_MESSAGE | 1691 print ACTIVATED_MESSAGE if active else NOT_ACTIVATED_MESSAGE |
| 1692 | 1692 |
| 1693 | 1693 |
| 1694 def main(): | 1694 def main(): |
| 1695 # Get inputs. | 1695 # Get inputs. |
| 1696 options, _ = parse_args() | 1696 options, _ = parse_args() |
| 1697 builder = options.builder_name | 1697 builder = options.builder_name |
| 1698 slave = options.slave_name | 1698 slave = options.slave_name |
| 1699 master = options.master | 1699 master = options.master |
| 1700 | 1700 |
| 1701 if not master: | 1701 # Always run. This option will be removed in a later CL, but for now make sure |
| 1702 # bot_update activation whitelist is checked only on buildbot masters. | 1702 # that bot_update is ALWAYS set to run, no matter what. |
| 1703 # If there is no master, bot_update is always active. | 1703 options.force = True |
| 1704 options.force = True | |
| 1705 | 1704 |
| 1706 # Check if this script should activate or not. | 1705 # Check if this script should activate or not. |
| 1707 active = options.force or check_valid_host(master, builder, slave) | 1706 active = options.force or check_valid_host(master, builder, slave) |
| 1708 | 1707 |
| 1709 # Print a helpful message to tell developers whats going on with this step. | 1708 # Print a helpful message to tell developers whats going on with this step. |
| 1710 print_help_text( | 1709 print_help_text( |
| 1711 options.force, options.output_json, active, master, builder, slave) | 1710 options.force, options.output_json, active, master, builder, slave) |
| 1712 | 1711 |
| 1713 # Parse, munipulate, and print the gclient solutions. | 1712 # Parse, munipulate, and print the gclient solutions. |
| 1714 specs = {} | 1713 specs = {} |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1743 except Exception: | 1742 except Exception: |
| 1744 # Unexpected failure. | 1743 # Unexpected failure. |
| 1745 emit_flag(options.flag_file) | 1744 emit_flag(options.flag_file) |
| 1746 raise | 1745 raise |
| 1747 else: | 1746 else: |
| 1748 emit_flag(options.flag_file) | 1747 emit_flag(options.flag_file) |
| 1749 | 1748 |
| 1750 | 1749 |
| 1751 if __name__ == '__main__': | 1750 if __name__ == '__main__': |
| 1752 sys.exit(main()) | 1751 sys.exit(main()) |
| OLD | NEW |