diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2014-06-11 10:19:03 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-06-13 11:55:33 +0100 |
commit | 74cd8c38aa434ab825931f30b957d7b4bf871a9a (patch) | |
tree | 83eb7e68f84eaded742b6d2bc9073e095b62e139 /bitbake/bin | |
parent | c7ae6bd30751a3020077b395dba929846dd1e020 (diff) | |
download | poky-74cd8c38aa434ab825931f30b957d7b4bf871a9a.tar.gz |
bitbake: xmlrpc: add support for token reusing
We add support to specify a connection token in the command line
and in the environment variable BBTOKEN.
When a client registers to a bitbake server, that client
will have exclusive access to the server. The client is identified
by a server-supplied token. If a client terminates, we cannot
reconnect to the server as the token is lost.
This patch adds the capability to specify the connection token
in the command line for xmlrpc clients. This allows us
to have bitbake work as an already-authenticated
client with the server and resume sending commands to a server.
(Bitbake rev: db5390940c0afbcdc9fbcf1225761968ae51d4a7)
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 f120baccf0..b3acbe1bd2 100755 --- a/bitbake/bin/bitbake +++ b/bitbake/bin/bitbake | |||
@@ -169,6 +169,9 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters): | |||
169 | parser.add_option("-t", "--servertype", help = "Choose which server to use, process or xmlrpc.", | 169 | parser.add_option("-t", "--servertype", help = "Choose which server to use, process or xmlrpc.", |
170 | action = "store", dest = "servertype") | 170 | action = "store", dest = "servertype") |
171 | 171 | ||
172 | parser.add_option("", "--token", help = "Specify the connection token to be used when connecting to a remote server.", | ||
173 | action = "store", dest = "xmlrpctoken") | ||
174 | |||
172 | parser.add_option("", "--revisions-changed", help = "Set the exit code depending on whether upstream floating revisions have changed or not.", | 175 | parser.add_option("", "--revisions-changed", help = "Set the exit code depending on whether upstream floating revisions have changed or not.", |
173 | action = "store_true", dest = "revisions_changed", default = False) | 176 | action = "store_true", dest = "revisions_changed", default = False) |
174 | 177 | ||
@@ -200,6 +203,9 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters): | |||
200 | options.servertype = "xmlrpc" | 203 | options.servertype = "xmlrpc" |
201 | options.remote_server = os.environ["BBSERVER"] | 204 | options.remote_server = os.environ["BBSERVER"] |
202 | 205 | ||
206 | if "BBTOKEN" in os.environ: | ||
207 | options.xmlrpctoken = os.environ["BBTOKEN"] | ||
208 | |||
203 | # if BBSERVER says to autodetect, let's do that | 209 | # if BBSERVER says to autodetect, let's do that |
204 | if options.remote_server: | 210 | if options.remote_server: |
205 | [host, port] = options.remote_server.split(":", 2) | 211 | [host, port] = options.remote_server.split(":", 2) |
@@ -332,7 +338,7 @@ def main(): | |||
332 | bb.event.ui_queue = [] | 338 | bb.event.ui_queue = [] |
333 | else: | 339 | else: |
334 | # we start a stub server that is actually a XMLRPClient that connects to a real server | 340 | # we start a stub server that is actually a XMLRPClient that connects to a real server |
335 | server = servermodule.BitBakeXMLRPCClient(configParams.observe_only) | 341 | server = servermodule.BitBakeXMLRPCClient(configParams.observe_only, configParams.xmlrpctoken) |
336 | server.saveConnectionDetails(configParams.remote_server) | 342 | server.saveConnectionDetails(configParams.remote_server) |
337 | 343 | ||
338 | 344 | ||