diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-01-05 15:45:37 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-06 15:27:35 +0000 |
commit | 773700dbc354425d599b223d72a0ccd2d034ce4a (patch) | |
tree | ba8560f143c83008bee21c426568a22023246dbb /bitbake | |
parent | 05b4fbc947cd2bf9493b74a80d1b58c8ddd480a2 (diff) | |
download | poky-773700dbc354425d599b223d72a0ccd2d034ce4a.tar.gz |
bitbake: xmplrpc: split connect method
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.
(Bitbake rev: 4429871da76d6bd29e023ff42740fe7daa6b40fa)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-x | bitbake/lib/bb/main.py | 1 | ||||
-rw-r--r-- | bitbake/lib/bb/server/__init__.py | 3 | ||||
-rw-r--r-- | bitbake/lib/bb/server/xmlrpc.py | 4 |
3 files changed, 6 insertions, 2 deletions
diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py index c8530fc3d8..dd0439391e 100755 --- a/bitbake/lib/bb/main.py +++ b/bitbake/lib/bb/main.py | |||
@@ -403,6 +403,7 @@ def bitbake_main(configParams, configuration): | |||
403 | if not configParams.server_only: | 403 | if not configParams.server_only: |
404 | try: | 404 | try: |
405 | server_connection = server.establishConnection(featureset) | 405 | server_connection = server.establishConnection(featureset) |
406 | server_connection.setupEventQueue() | ||
406 | except Exception as e: | 407 | except Exception as e: |
407 | bb.fatal("Could not connect to server %s: %s" % (configParams.remote_server, str(e))) | 408 | bb.fatal("Could not connect to server %s: %s" % (configParams.remote_server, str(e))) |
408 | 409 | ||
diff --git a/bitbake/lib/bb/server/__init__.py b/bitbake/lib/bb/server/__init__.py index da5e480740..538a633fe5 100644 --- a/bitbake/lib/bb/server/__init__.py +++ b/bitbake/lib/bb/server/__init__.py | |||
@@ -63,6 +63,9 @@ class BitBakeBaseServerConnection(): | |||
63 | def terminate(self): | 63 | def terminate(self): |
64 | pass | 64 | pass |
65 | 65 | ||
66 | def setupEventQueue(self): | ||
67 | pass | ||
68 | |||
66 | 69 | ||
67 | """ BitBakeBaseServer class is the common ancestor to all Bitbake servers | 70 | """ BitBakeBaseServer class is the common ancestor to all Bitbake servers |
68 | 71 | ||
diff --git a/bitbake/lib/bb/server/xmlrpc.py b/bitbake/lib/bb/server/xmlrpc.py index 17eb28b7d4..1ceca51e0a 100644 --- a/bitbake/lib/bb/server/xmlrpc.py +++ b/bitbake/lib/bb/server/xmlrpc.py | |||
@@ -302,7 +302,9 @@ class BitBakeXMLRPCServerConnection(BitBakeBaseServerConnection): | |||
302 | return None | 302 | return None |
303 | 303 | ||
304 | self.transport.set_connection_token(token) | 304 | self.transport.set_connection_token(token) |
305 | return self | ||
305 | 306 | ||
307 | def setupEventQueue(self): | ||
306 | self.events = uievent.BBUIEventQueue(self.connection, self.clientinfo) | 308 | self.events = uievent.BBUIEventQueue(self.connection, self.clientinfo) |
307 | for event in bb.event.ui_queue: | 309 | for event in bb.event.ui_queue: |
308 | self.events.queue_event(event) | 310 | self.events.queue_event(event) |
@@ -314,8 +316,6 @@ class BitBakeXMLRPCServerConnection(BitBakeBaseServerConnection): | |||
314 | # no need to log it here, the error shall be sent to the client | 316 | # no need to log it here, the error shall be sent to the client |
315 | raise BaseException(error) | 317 | raise BaseException(error) |
316 | 318 | ||
317 | return self | ||
318 | |||
319 | def removeClient(self): | 319 | def removeClient(self): |
320 | if not self.observer_only: | 320 | if not self.observer_only: |
321 | self.connection.removeClient() | 321 | self.connection.removeClient() |