Patchwork [bitbake-devel] xmlrpc: removes the event servers controller

login
register
mail settings
Submitter Alexandru DAMIAN
Date June 7, 2013, 4:03 p.m.
Message ID <1370620986-23507-1-git-send-email-alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/51339/
State Accepted
Commit e171a363913a86e56266f4c9d107110c7f5221e3
Headers show

Comments

Alexandru DAMIAN - June 7, 2013, 4:03 p.m.
From: Alexandru DAMIAN <alexandru.damian@intel.com>

XMLRPC API ran a XMLRPC server at port+2 in order
to provide endpoints to register an event server
in which to dump the events.

This is no longer used, so we remove it.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
---
 lib/bb/server/xmlrpc.py | 59 -------------------------------------------------
 1 file changed, 59 deletions(-)

Patch

diff --git a/lib/bb/server/xmlrpc.py b/lib/bb/server/xmlrpc.py
index 1b3502e..44cea10 100644
--- a/lib/bb/server/xmlrpc.py
+++ b/lib/bb/server/xmlrpc.py
@@ -272,59 +272,6 @@  class BitBakeUIEventServer(threading.Thread):
             if evt:
                 self.connection.event.sendpickle(pickle.dumps(evt))
 
-class BitBakeXMLRPCEventServerController(SimpleXMLRPCServer, threading.Thread):
-    def __init__(self, interface):
-        SimpleXMLRPCServer.__init__(self, interface, logRequests=False, allow_none=True)
-        threading.Thread.__init__(self)
-        self.register_function(self.registerEventHandler, "registerEventHandler")
-        self.register_function(self.unregisterEventHandler, "unregisterEventHandler")
-        self.register_function(self.terminateServer, "terminateServer")
-        #self.register_function(self.runCommand, "runCommand")
-        self.quit = False
-        self.clients = {}
-        self.client_ui_ids = {}
-        self.timeout = 1    # timeout for .handle_request()
-
-    def registerEventHandler(self, host, port):
-        """
-        Register a remote UI Event Handler
-        """
-        connection = xmlrpclib.ServerProxy("http://%s:%d/" % (host, port), allow_none=True)
-        client_hash = "%s:%d" % (host, port)
-        if self.clients.has_key(client_hash):
-            return None
-        client_ui_server = BitBakeUIEventServer(connection)
-        self.client_ui_ids[client_hash] = bb.event.register_UIHhandler(client_ui_server)
-        client_ui_server.start()
-        self.clients[client_hash] = client_ui_server
-        return client_hash
-
-    def unregisterEventHandler(self, client_hash):
-        """
-        Unregister a remote UI Event Handler
-        """
-        client_thread = self.clients[client_hash]
-        if client_thread:
-            bb.event.unregister_UIHhandler(self.clients_ui_ids[client_hash])
-            client_thread.terminateServer()
-            client_thread.join()
-            return True
-        else:
-            return False
-
-    def terminateServer(self):
-        self.quit = True
-
-    def runCommand(self, cmd):
-        return None
-
-    def run(self):
-        self.serve_forever()
-
-    def serve_forever(self):
-        while not self.quit:
-            self.handle_request()
-        self.server_close()
 
 class XMLRPCProxyServer(BaseImplServer):
     """ not a real working server, but a stub for a proxy server connection
@@ -369,9 +316,6 @@  class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer):
 
 
     def serve_forever(self):
-        # Create and run the event server controller in a separate thread
-        self.event_controller_thread = BitBakeXMLRPCEventServerController((self.host, self.port + 2))
-        self.event_controller_thread.start()
         # Start the actual XMLRPC server
         bb.cooker.server_main(self.cooker, self._serve_forever)
 
@@ -414,9 +358,6 @@  class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer):
                 retval = function(self, data, True)
             except:
                 pass
-        # Terminate the event server
-        self.event_controller_thread.terminateServer()
-        self.event_controller_thread.join()
         self.server_close()
         return