diff options
author | Benjamin Esquivel <benjamin.esquivel@linux.intel.com> | 2016-10-07 16:46:26 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-10-09 12:33:26 +0100 |
commit | b9d6a7cc234f44e44e5421191924b7463e9c0a9d (patch) | |
tree | 30d346650b78b584e5fdf17dfd6de2f978b2817a /bitbake/lib/bb/main.py | |
parent | 77e56194dc8a81509b1977e1f329f91ce128a9c0 (diff) | |
download | poky-b9d6a7cc234f44e44e5421191924b7463e9c0a9d.tar.gz |
bitbake: main: Check bitbake server-only port is a number
Either using the memres script or the bitbake call with --server-only
if the port is a string instead of a number then the process hangs
indefinitely causing a loop that never ends.
Add a check at the beginning for the port being a number otherwise
show an error message and exit cleanly.
[YOCTO #10397]
(Bitbake rev: 35927a98daeeb854ef5782e900206af6cd96b3d7)
Signed-off-by: Benjamin Esquivel <benjamin.esquivel@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/main.py')
-rwxr-xr-x | bitbake/lib/bb/main.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py index 7f7d87bd02..f2f59f670a 100755 --- a/bitbake/lib/bb/main.py +++ b/bitbake/lib/bb/main.py | |||
@@ -402,6 +402,13 @@ def bitbake_main(configParams, configuration): | |||
402 | if not configParams.bind: | 402 | if not configParams.bind: |
403 | raise BBMainException("FATAL: The '--server-only' option requires a name/address " | 403 | raise BBMainException("FATAL: The '--server-only' option requires a name/address " |
404 | "to bind to with the -B option.\n") | 404 | "to bind to with the -B option.\n") |
405 | else: | ||
406 | try: | ||
407 | #Checking that the port is a number | ||
408 | int(configParams.bind.split(":")[1]) | ||
409 | except (ValueError,IndexError): | ||
410 | raise BBMainException( | ||
411 | "FATAL: Malformed host:port bind parameter") | ||
405 | if configParams.remote_server: | 412 | if configParams.remote_server: |
406 | raise BBMainException("FATAL: The '--server-only' option conflicts with %s.\n" % | 413 | raise BBMainException("FATAL: The '--server-only' option conflicts with %s.\n" % |
407 | ("the BBSERVER environment variable" if "BBSERVER" in os.environ \ | 414 | ("the BBSERVER environment variable" if "BBSERVER" in os.environ \ |