blob: 6a55073551f98819af34bf095ca221089c3f4fc3 [file] [log] [blame]
#!/usr/bin/env python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""The main task entrypoint."""
import argparse
import logging
import socket
import sys
import time
#pylint: disable=relative-import
import common_lib
import rpc_server
def main():
print ' '.join(sys.argv)
common_lib.InitLogging()'Task starting')
parser = argparse.ArgumentParser()
help='One time token used to authenticate with the host')
help='The ip address of the controller machine')
parser.add_argument('--idle-timeout', type=int,
help='The idle timeout for the rpc server in seconds')
args, _ = parser.parse_known_args()
'Registering with registration server at %s using OTP "%s"',
args.controller, args.otp)
server = common_lib.ConnectToServer(args.controller).RegisterTask(
args.otp, common_lib.MY_IP)
server = rpc_server.RPCServer(args.controller, args.idle_timeout)
return 0
if __name__ == '__main__':