aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/prserv
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-02 15:46:11 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-03 16:24:13 +0100
commita4cc40c6227b1212d82450c3b2adc1e08061966f (patch)
tree2f46e6ff8864b1d647e607bafb70713fd57e4920 /bitbake/lib/prserv
parent8779ebcc902641203ab2eb2be06964dd922b591a (diff)
downloadopenembedded-core-contrib-a4cc40c6227b1212d82450c3b2adc1e08061966f.tar.gz
bitbake: prserv/cooker: Handle PRService errors cleanly
Current if the PR Service fails to start, bitbake carries on regardless or hangs with no error message. This adds an exception and then handles it correctly so the UIs correctly handle the error and exit cleanly. [YOCTO #4010] (Bitbake rev: 949c01228a977c3b92bfc0802f6c71b40d8e05b3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/prserv')
-rw-r--r--bitbake/lib/prserv/serv.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/bitbake/lib/prserv/serv.py b/bitbake/lib/prserv/serv.py
index 3489200536..6132100eed 100644
--- a/bitbake/lib/prserv/serv.py
+++ b/bitbake/lib/prserv/serv.py
@@ -263,6 +263,9 @@ def is_local_special(host, port):
else:
return False
+class PRServiceConfigError(Exception):
+ pass
+
def auto_start(d):
global singleton
@@ -273,14 +276,14 @@ def auto_start(d):
if len(host_params) != 2:
logger.critical('\n'.join(['PRSERV_HOST: incorrect format',
'Usage: PRSERV_HOST = "<hostname>:<port>"']))
- return True
+ raise PRServiceConfigError
if is_local_special(host_params[0], int(host_params[1])) and not singleton:
import bb.utils
cachedir = (d.getVar("PERSISTENT_DIR", True) or d.getVar("CACHE", True))
if not cachedir:
logger.critical("Please set the 'PERSISTENT_DIR' or 'CACHE' variable")
- sys.exit(1)
+ raise PRServiceConfigError
bb.utils.mkdirhier(cachedir)
dbfile = os.path.join(cachedir, "prserv.sqlite3")
logfile = os.path.join(cachedir, "prserv.log")
@@ -296,7 +299,7 @@ def auto_start(d):
return PRServerConnection(host,port).ping()
except Exception:
logger.critical("PRservice %s:%d not available" % (host, port))
- return False
+ raise PRServiceConfigError
def auto_shutdown(d=None):
global singleton