summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/cooker.py5
-rw-r--r--bitbake/lib/prserv/serv.py9
2 files changed, 10 insertions, 4 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 7ca1ffdd94..c39d522c47 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1353,7 +1353,10 @@ class BBCooker:
1353 # Empty the environment. The environment will be populated as 1353 # Empty the environment. The environment will be populated as
1354 # necessary from the data store. 1354 # necessary from the data store.
1355 #bb.utils.empty_environment() 1355 #bb.utils.empty_environment()
1356 prserv.serv.auto_start(self.configuration.data) 1356 try:
1357 prserv.serv.auto_start(self.configuration.data)
1358 except prserv.serv.PRServiceConfigError:
1359 bb.event.fire(CookerExit(), self.configuration.event_data)
1357 return 1360 return
1358 1361
1359 def post_serve(self): 1362 def post_serve(self):
diff --git a/bitbake/lib/prserv/serv.py b/bitbake/lib/prserv/serv.py
index 5567c6f574..316512d7ac 100644
--- a/bitbake/lib/prserv/serv.py
+++ b/bitbake/lib/prserv/serv.py
@@ -266,17 +266,20 @@ def is_local_special(host, port):
266 else: 266 else:
267 return False 267 return False
268 268
269class PRServiceConfigError(Exception):
270 pass
271
269def auto_start(d): 272def auto_start(d):
270 global singleton 273 global singleton
271 if (not d.getVar('PRSERV_HOST', True)) or (not d.getVar('PRSERV_PORT', True)): 274 if (not d.getVar('PRSERV_HOST', True)) or (not d.getVar('PRSERV_PORT', True)):
272 return True 275 return
273 276
274 if is_local_special(d.getVar('PRSERV_HOST', True), int(d.getVar('PRSERV_PORT', True))) and not singleton: 277 if is_local_special(d.getVar('PRSERV_HOST', True), int(d.getVar('PRSERV_PORT', True))) and not singleton:
275 import bb.utils 278 import bb.utils
276 cachedir = (d.getVar("PERSISTENT_DIR", True) or d.getVar("CACHE", True)) 279 cachedir = (d.getVar("PERSISTENT_DIR", True) or d.getVar("CACHE", True))
277 if not cachedir: 280 if not cachedir:
278 logger.critical("Please set the 'PERSISTENT_DIR' or 'CACHE' variable") 281 logger.critical("Please set the 'PERSISTENT_DIR' or 'CACHE' variable")
279 sys.exit(1) 282 raise PRServiceConfigError
280 bb.utils.mkdirhier(cachedir) 283 bb.utils.mkdirhier(cachedir)
281 dbfile = os.path.join(cachedir, "prserv.sqlite3") 284 dbfile = os.path.join(cachedir, "prserv.sqlite3")
282 logfile = os.path.join(cachedir, "prserv.log") 285 logfile = os.path.join(cachedir, "prserv.log")
@@ -292,7 +295,7 @@ def auto_start(d):
292 return PRServerConnection(host,port).ping() 295 return PRServerConnection(host,port).ping()
293 except Exception: 296 except Exception:
294 logger.critical("PRservice %s:%d not available" % (host, port)) 297 logger.critical("PRservice %s:%d not available" % (host, port))
295 return False 298 raise PRServiceConfigError
296 299
297def auto_shutdown(d=None): 300def auto_shutdown(d=None):
298 global singleton 301 global singleton