| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 | 6 |
| 7 """ Launch multiple buildbot slave instances on a single machine. This script | 7 """ Launch multiple buildbot slave instances on a single machine. This script |
| 8 is intended to be run at boot time. """ | 8 is intended to be run at boot time. """ |
| 9 | 9 |
| 10 | 10 |
| 11 from contextlib import closing | 11 from contextlib import closing |
| 12 | 12 |
| 13 import json | 13 import json |
| 14 import multiprocessing | 14 import multiprocessing |
| 15 import os | 15 import os |
| 16 if os.name == 'nt': | 16 if os.name == 'nt': |
| 17 import win32api | 17 import win32api |
| 18 import string | 18 import string |
| 19 import shutil | 19 import shutil |
| 20 import socket | 20 import socket |
| 21 import subprocess | 21 import subprocess |
| 22 import sys | 22 import sys |
| 23 import time | 23 import time |
| 24 import urllib2 | 24 import urllib2 |
| 25 | 25 |
| 26 | 26 |
| 27 def GetGlobalVariables(): | 27 def GetGlobalVariables(): |
| 28 """ Retrieve a global variable from the global_variables.json file. """ | 28 """ Retrieve a global variable from the global_variables.json file. """ |
| 29 global_variables_file = ('http://skia.googlecode.com/svn/buildbot/' | 29 global_variables_file = ('http://skia.googlecode.com/svn/buildbot/' |
| 30 'site_config/global_variables.json') | 30 'site_config/global_variables_2.json') |
| 31 with closing(urllib2.urlopen(global_variables_file)) as f: | 31 with closing(urllib2.urlopen(global_variables_file)) as f: |
| 32 return json.load(f) | 32 return json.load(f) |
| 33 | 33 |
| 34 | 34 |
| 35 def GetGlobalVariable(var_name): | 35 def GetGlobalVariable(var_name): |
| 36 return GLOBAL_VARIABLES[var_name]['value'] | 36 return GLOBAL_VARIABLES[var_name]['value'] |
| 37 | 37 |
| 38 | 38 |
| 39 # How often we should check each buildslave's keepalive conditions, in seconds. | 39 # How often we should check each buildslave's keepalive conditions, in seconds. |
| 40 DEFAULT_POLL_INTERVAL = 60 | 40 DEFAULT_POLL_INTERVAL = 60 |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 # Obtain buildslave-specific configuration information. | 344 # Obtain buildslave-specific configuration information. |
| 345 slaves_cfg = GetSlavesCfg() | 345 slaves_cfg = GetSlavesCfg() |
| 346 | 346 |
| 347 # Launch the build slaves | 347 # Launch the build slaves |
| 348 for slavename in slaves: | 348 for slavename in slaves: |
| 349 RunSlave(slavename, copies, slaves_cfg, master_host) | 349 RunSlave(slavename, copies, slaves_cfg, master_host) |
| 350 | 350 |
| 351 | 351 |
| 352 if '__main__' == __name__: | 352 if '__main__' == __name__: |
| 353 sys.exit(main()) | 353 sys.exit(main()) |
| OLD | NEW |