summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2013-06-07 17:03:06 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-14 14:34:59 +0100
commit4aebdecdd7ab6147c5357adfe7b99c8ad4182b30 (patch)
tree66e4a4cedd3fa1323ba57438a985bebf3ad789f2
parent07ba7936d431f5d2d56ad7d2b6ac29d65edf4a0f (diff)
downloadpoky-4aebdecdd7ab6147c5357adfe7b99c8ad4182b30.tar.gz
bitbake: xmlrpc: removes the event servers controller
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. (Bitbake rev: e171a363913a86e56266f4c9d107110c7f5221e3) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/server/xmlrpc.py59
1 files changed, 0 insertions, 59 deletions
diff --git a/bitbake/lib/bb/server/xmlrpc.py b/bitbake/lib/bb/server/xmlrpc.py
index 0b51ebd20f..359d5adb67 100644
--- a/bitbake/lib/bb/server/xmlrpc.py
+++ b/bitbake/lib/bb/server/xmlrpc.py
@@ -272,59 +272,6 @@ class BitBakeUIEventServer(threading.Thread):
272 if evt: 272 if evt:
273 self.connection.event.sendpickle(pickle.dumps(evt)) 273 self.connection.event.sendpickle(pickle.dumps(evt))
274 274
275class BitBakeXMLRPCEventServerController(SimpleXMLRPCServer, threading.Thread):
276 def __init__(self, interface):
277 SimpleXMLRPCServer.__init__(self, interface, logRequests=False, allow_none=True)
278 threading.Thread.__init__(self)
279 self.register_function(self.registerEventHandler, "registerEventHandler")
280 self.register_function(self.unregisterEventHandler, "unregisterEventHandler")
281 self.register_function(self.terminateServer, "terminateServer")
282 #self.register_function(self.runCommand, "runCommand")
283 self.quit = False
284 self.clients = {}
285 self.client_ui_ids = {}
286 self.timeout = 1 # timeout for .handle_request()
287
288 def registerEventHandler(self, host, port):
289 """
290 Register a remote UI Event Handler
291 """
292 connection = xmlrpclib.ServerProxy("http://%s:%d/" % (host, port), allow_none=True)
293 client_hash = "%s:%d" % (host, port)
294 if self.clients.has_key(client_hash):
295 return None
296 client_ui_server = BitBakeUIEventServer(connection)
297 self.client_ui_ids[client_hash] = bb.event.register_UIHhandler(client_ui_server)
298 client_ui_server.start()
299 self.clients[client_hash] = client_ui_server
300 return client_hash
301
302 def unregisterEventHandler(self, client_hash):
303 """
304 Unregister a remote UI Event Handler
305 """
306 client_thread = self.clients[client_hash]
307 if client_thread:
308 bb.event.unregister_UIHhandler(self.clients_ui_ids[client_hash])
309 client_thread.terminateServer()
310 client_thread.join()
311 return True
312 else:
313 return False
314
315 def terminateServer(self):
316 self.quit = True
317
318 def runCommand(self, cmd):
319 return None
320
321 def run(self):
322 self.serve_forever()
323
324 def serve_forever(self):
325 while not self.quit:
326 self.handle_request()
327 self.server_close()
328 275
329class XMLRPCProxyServer(BaseImplServer): 276class XMLRPCProxyServer(BaseImplServer):
330 """ not a real working server, but a stub for a proxy server connection 277 """ not a real working server, but a stub for a proxy server connection
@@ -369,9 +316,6 @@ class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer):
369 316
370 317
371 def serve_forever(self): 318 def serve_forever(self):
372 # Create and run the event server controller in a separate thread
373 self.event_controller_thread = BitBakeXMLRPCEventServerController((self.host, self.port + 2))
374 self.event_controller_thread.start()
375 # Start the actual XMLRPC server 319 # Start the actual XMLRPC server
376 bb.cooker.server_main(self.cooker, self._serve_forever) 320 bb.cooker.server_main(self.cooker, self._serve_forever)
377 321
@@ -414,9 +358,6 @@ class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer):
414 retval = function(self, data, True) 358 retval = function(self, data, True)
415 except: 359 except:
416 pass 360 pass
417 # Terminate the event server
418 self.event_controller_thread.terminateServer()
419 self.event_controller_thread.join()
420 self.server_close() 361 self.server_close()
421 return 362 return
422 363