Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Side by Side Diff: testing/legion/client_controller.py

Issue 890773003: Adding the initial code for Omnibot multi-machine support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing initial comments Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #!/usr/bin/env python
Marc-Antoine Ruel (Google) 2015/01/30 21:58:38 Saved 19 lines, or 28% of lines, not too bad. :) I
Mike Meade 2015/02/03 01:18:07 Acknowledged.
2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5 """The main client_controller code.
6
7 This code is the main entry point for the client machines and handles
8 registering with the host server and running the local RPC server.
9 """
10
11 import argparse
12 import logging
13 import socket
14 import sys
15 import time
16
17 #pylint: disable=relative-import
18 import client_rpc_server
19 import common_lib
20 import discovery_server
21
22
23 def main():
24 common_lib.InitLogging()
25 common_lib.LogCommandLine()
26 logging.info('Client controller starting')
27
28 parser = argparse.ArgumentParser()
29 parser.add_argument('--otp')
30 parser.add_argument('--host')
31 parser.add_argument('--idle-timeout', type=int)
32 args, _ = parser.parse_known_args()
33
34 logging.info(
35 'Registering with discovery server using OTP %s', args.otp)
36 server = discovery_server.DiscoveryServer.Connect(args.host).RegisterClient(
37 args.otp, common_lib.MY_IP)
38
39 server = client_rpc_server.RPCServer()
40 server.AddAuthorizedAddress(args.host)
41 if args.idle_timeout:
42 server.SetIdleTimeout(args.idle_timeout)
43
44 server.serve_forever()
45 return 0
46
47
48 if __name__ == '__main__':
49 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698