diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2013-06-17 12:11:51 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-06-17 16:09:10 +0100 |
commit | 3ea9d647ec35c4d30dcaa5b58e9471b775a4716c (patch) | |
tree | e3e5022ce0e34320bd555942c418a3cb02282651 /bitbake/bin | |
parent | 194b395f85dbed216b7dd51e66f8b567955307f2 (diff) | |
download | poky-3ea9d647ec35c4d30dcaa5b58e9471b775a4716c.tar.gz |
bitbake: knotty, xmlrpc: add observer-only mode
I add an observer only mode for the knotty UI and
the XMLRPC server that will allow the UI to register
a callback with a server in order to receive events.
The observer-UI is able to send read-only commands to the
server, and also is able to register as an event handler.
Read-only commands are the commands that do not change
the state of the server and have been marked as such in
the command module.
The observer can switch to a full client if it calls addClient
at any time, and the server has no other client running.
(Bitbake rev: 4de9ee21f1fa4d04937cc7430fb1fc8b7a8f61e2)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-x | bitbake/bin/bitbake | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake index 1fac9feb24..e77266b4ba 100755 --- a/bitbake/bin/bitbake +++ b/bitbake/bin/bitbake | |||
@@ -197,6 +197,9 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters): | |||
197 | parser.add_option("", "--remote-server", help = "Connect to the specified server", | 197 | parser.add_option("", "--remote-server", help = "Connect to the specified server", |
198 | action = "store", dest = "remote_server", default = False) | 198 | action = "store", dest = "remote_server", default = False) |
199 | 199 | ||
200 | parser.add_option("", "--observe-only", help = "Connect to a server as an observing-only client", | ||
201 | action = "store_true", dest = "observe_only", default = False) | ||
202 | |||
200 | options, targets = parser.parse_args(sys.argv) | 203 | options, targets = parser.parse_args(sys.argv) |
201 | return options, targets[1:] | 204 | return options, targets[1:] |
202 | 205 | ||
@@ -269,6 +272,9 @@ def main(): | |||
269 | if configParams.remote_server and configParams.servertype != "xmlrpc": | 272 | if configParams.remote_server and configParams.servertype != "xmlrpc": |
270 | sys.exit("FATAL: If '--remote-server' is defined, we must set the servertype as 'xmlrpc'.\n") | 273 | sys.exit("FATAL: If '--remote-server' is defined, we must set the servertype as 'xmlrpc'.\n") |
271 | 274 | ||
275 | if configParams.observe_only and (not configParams.remote_server or configParams.bind): | ||
276 | sys.exit("FATAL: '--observe-only' can only be used by UI clients connecting to a server.\n") | ||
277 | |||
272 | if "BBDEBUG" in os.environ: | 278 | if "BBDEBUG" in os.environ: |
273 | level = int(os.environ["BBDEBUG"]) | 279 | level = int(os.environ["BBDEBUG"]) |
274 | if level > configuration.debug: | 280 | if level > configuration.debug: |
@@ -295,7 +301,7 @@ def main(): | |||
295 | server = start_server(servermodule, configParams, configuration) | 301 | server = start_server(servermodule, configParams, configuration) |
296 | else: | 302 | else: |
297 | # we start a stub server that is actually a XMLRPClient to | 303 | # we start a stub server that is actually a XMLRPClient to |
298 | server = servermodule.BitBakeXMLRPCClient() | 304 | server = servermodule.BitBakeXMLRPCClient(configParams.observe_only) |
299 | server.saveConnectionDetails(configParams.remote_server) | 305 | server.saveConnectionDetails(configParams.remote_server) |
300 | 306 | ||
301 | logger.removeHandler(handler) | 307 | logger.removeHandler(handler) |