]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
xmplrpc: split connect method
authorEd Bartosh <ed.bartosh@linux.intel.com>
Tue, 5 Jan 2016 13:45:37 +0000 (15:45 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 5 Jan 2016 17:59:13 +0000 (17:59 +0000)
Current code in connect method sets up event queue, which requires
registering UI handler. This functionality may not be needed for
some operations, e.g. for server termination.

Moved functionality of setting up event queue in from 'connect'
method to 'setupEventQueue' in BitBakeXMLRPCServerConnection class.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/main.py
lib/bb/server/__init__.py
lib/bb/server/xmlrpc.py

index c8530fc3d865ad3e1f9b69bb0af424b42b8e9b63..dd0439391e9e716f6a7d8d071438ac8013408177 100755 (executable)
@@ -403,6 +403,7 @@ def bitbake_main(configParams, configuration):
     if not configParams.server_only:
         try:
             server_connection = server.establishConnection(featureset)
+            server_connection.setupEventQueue()
         except Exception as e:
             bb.fatal("Could not connect to server %s: %s" % (configParams.remote_server, str(e)))
 
index da5e48074014472b39a1cf92c085cd711f0545f6..538a633fe59ad09f42ad4a182f080fdc1ba39110 100644 (file)
@@ -63,6 +63,9 @@ class BitBakeBaseServerConnection():
     def terminate(self):
         pass
 
+    def setupEventQueue(self):
+        pass
+
 
 """ BitBakeBaseServer class is the common ancestor to all Bitbake servers
 
index 17eb28b7d423161d8beb3b33f81599740b1d4e30..1ceca51e0ae0aae8b38541934bc1ba5e7f428c1e 100644 (file)
@@ -302,7 +302,9 @@ class BitBakeXMLRPCServerConnection(BitBakeBaseServerConnection):
             return None
 
         self.transport.set_connection_token(token)
+        return self
 
+    def setupEventQueue(self):
         self.events = uievent.BBUIEventQueue(self.connection, self.clientinfo)
         for event in bb.event.ui_queue:
             self.events.queue_event(event)
@@ -314,8 +316,6 @@ class BitBakeXMLRPCServerConnection(BitBakeBaseServerConnection):
             # no need to log it here, the error shall be sent to the client
             raise BaseException(error)
 
-        return self
-
     def removeClient(self):
         if not self.observer_only:
             self.connection.removeClient()