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

Unified Diff: testing/legion/task_registration_server.py

Issue 951673002: Revert "Pull chromium at 2c3ffb2355a27c32f45e508ef861416b820c823b" (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « testing/legion/task_controller.py ('k') | testing/legion/test_controller.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/legion/task_registration_server.py
diff --git a/testing/legion/task_registration_server.py b/testing/legion/task_registration_server.py
deleted file mode 100644
index 52ba727056d7f22511214571bbff7962e4db7a8a..0000000000000000000000000000000000000000
--- a/testing/legion/task_registration_server.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# 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 registration server used to register tasks.
-
-The registration server is started by the test controller and allows the tasks
-to register themselves when they start. Authentication of the tasks controllers
-is based on an OTP passed to the run_task binary on startup.
-"""
-
-import logging
-import threading
-import xmlrpclib
-import SimpleXMLRPCServer
-
-#pylint: disable=relative-import
-import common_lib
-
-
-class TaskRegistrationServer(object):
- """Discovery server run on the host."""
-
- def __init__(self):
- self._expected_tasks = {}
- self._rpc_server = None
- self._thread = None
-
- def _RegisterTaskRPC(self, otp, ip):
- """The RPC used by a task to register with the registration server."""
- assert otp in self._expected_tasks
- cb = self._expected_tasks.pop(otp)
- cb(ip)
-
- def RegisterTaskCallback(self, otp, callback):
- """Registers a callback associated with an OTP."""
- assert callable(callback)
- self._expected_tasks[otp] = callback
-
- def Start(self):
- """Starts the registration server."""
- logging.debug('Starting task registration server')
- self._rpc_server = SimpleXMLRPCServer.SimpleXMLRPCServer(
- (common_lib.SERVER_ADDRESS, common_lib.SERVER_PORT),
- allow_none=True, logRequests=False)
- self._rpc_server.register_function(
- self._RegisterTaskRPC, 'RegisterTask')
- self._thread = threading.Thread(target=self._rpc_server.serve_forever)
- self._thread.start()
-
- def Shutdown(self):
- """Shuts the discovery server down."""
- if self._thread and self._thread.is_alive():
- logging.debug('Shutting down task registration server')
- self._rpc_server.shutdown()
« no previous file with comments | « testing/legion/task_controller.py ('k') | testing/legion/test_controller.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698