OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Common library methods used by both coordinator and task machines.""" | 5 """Common library methods used by both host and client controllers.""" |
6 | 6 |
7 import argparse | 7 import argparse |
8 import logging | 8 import logging |
9 import os | 9 import os |
10 import socket | 10 import socket |
11 import xmlrpclib | 11 import xmlrpclib |
12 | 12 |
13 LOGGING_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'WARN', 'ERROR'] | 13 LOGGING_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'WARN', 'ERROR'] |
14 MY_IP = socket.gethostbyname(socket.gethostname()) | 14 MY_IP = socket.gethostbyname(socket.gethostname()) |
15 SERVER_ADDRESS = '' | 15 SERVER_ADDRESS = '' |
(...skipping 18 matching lines...) Expand all Loading... |
34 logging.basicConfig( | 34 logging.basicConfig( |
35 format='%(asctime)s %(filename)s:%(lineno)s %(levelname)s] %(message)s', | 35 format='%(asctime)s %(filename)s:%(lineno)s %(levelname)s] %(message)s', |
36 datefmt='%H:%M:%S', level=args.verbosity) | 36 datefmt='%H:%M:%S', level=args.verbosity) |
37 | 37 |
38 | 38 |
39 def ConnectToServer(server): | 39 def ConnectToServer(server): |
40 """Connect to an RPC server.""" | 40 """Connect to an RPC server.""" |
41 addr = 'http://%s:%d' % (server, SERVER_PORT) | 41 addr = 'http://%s:%d' % (server, SERVER_PORT) |
42 logging.debug('Connecting to RPC server at %s', addr) | 42 logging.debug('Connecting to RPC server at %s', addr) |
43 return xmlrpclib.Server(addr) | 43 return xmlrpclib.Server(addr) |
OLD | NEW |