summaryrefslogtreecommitdiffstats
path: root/bin/bitbake
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2013-06-17 12:11:51 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-17 16:08:30 +0100
commit4de9ee21f1fa4d04937cc7430fb1fc8b7a8f61e2 (patch)
tree47f2564af429444e3338d7f42dd1e4c6bf5d8eb7 /bin/bitbake
parentd48e8bcb24e8fa5d4fd60fd2c9927a95976d8d8b (diff)
downloadbitbake-contrib-4de9ee21f1fa4d04937cc7430fb1fc8b7a8f61e2.tar.gz
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. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bin/bitbake')
-rwxr-xr-xbin/bitbake8
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/bitbake b/bin/bitbake
index 1fac9feb2..e77266b4b 100755
--- a/bin/bitbake
+++ b/bin/bitbake
@@ -197,6 +197,9 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters):
parser.add_option("", "--remote-server", help = "Connect to the specified server",
action = "store", dest = "remote_server", default = False)
+ parser.add_option("", "--observe-only", help = "Connect to a server as an observing-only client",
+ action = "store_true", dest = "observe_only", default = False)
+
options, targets = parser.parse_args(sys.argv)
return options, targets[1:]
@@ -269,6 +272,9 @@ def main():
if configParams.remote_server and configParams.servertype != "xmlrpc":
sys.exit("FATAL: If '--remote-server' is defined, we must set the servertype as 'xmlrpc'.\n")
+ if configParams.observe_only and (not configParams.remote_server or configParams.bind):
+ sys.exit("FATAL: '--observe-only' can only be used by UI clients connecting to a server.\n")
+
if "BBDEBUG" in os.environ:
level = int(os.environ["BBDEBUG"])
if level > configuration.debug:
@@ -295,7 +301,7 @@ def main():
server = start_server(servermodule, configParams, configuration)
else:
# we start a stub server that is actually a XMLRPClient to
- server = servermodule.BitBakeXMLRPCClient()
+ server = servermodule.BitBakeXMLRPCClient(configParams.observe_only)
server.saveConnectionDetails(configParams.remote_server)
logger.removeHandler(handler)