aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/prserv
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-07 18:13:04 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-14 12:52:57 +0100
commit5ebd9bfff19a73ace09360f74b6171fe1a6a8f2e (patch)
tree5416dc5a322553e93314be7291c0b5a6daaaa669 /bitbake/lib/prserv
parentefb877bcdb9584707efab4cee564afecb340e480 (diff)
downloadopenembedded-core-contrib-5ebd9bfff19a73ace09360f74b6171fe1a6a8f2e.tar.gz
bitbake: prserv: Adapt autostart to bitbake-worker
With the change to bitbake-worker we need to ensure the workers know how to contact the PR service, the magic 0 port and singleton is no longer enough. (Bitbake rev: c761751e259bb8e940552a28794b45887b5a72d9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/prserv')
-rw-r--r--bitbake/lib/prserv/serv.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/bitbake/lib/prserv/serv.py b/bitbake/lib/prserv/serv.py
index d7ab9ee0d5..7f9331d13b 100644
--- a/bitbake/lib/prserv/serv.py
+++ b/bitbake/lib/prserv/serv.py
@@ -207,6 +207,9 @@ class PRServerConnection():
def importone(self, version, pkgarch, checksum, value):
return self.connection.importone(version, pkgarch, checksum, value)
+ def getinfo(self):
+ return self.host, self.port
+
def start_daemon(dbfile, host, port, logfile):
pidfile = PIDPREFIX % (host, port)
try:
@@ -271,7 +274,7 @@ def auto_start(d):
host_params = filter(None, (d.getVar('PRSERV_HOST', True) or '').split(':'))
if not host_params:
- return True
+ return None
if len(host_params) != 2:
logger.critical('\n'.join(['PRSERV_HOST: incorrect format',
@@ -296,7 +299,11 @@ def auto_start(d):
port = int(host_params[1])
try:
- return PRServerConnection(host,port).ping()
+ connection = PRServerConnection(host,port)
+ connection.ping()
+ realhost, realport = connection.getinfo()
+ return str(realhost) + ":" + str(realport)
+
except Exception:
logger.critical("PRservice %s:%d not available" % (host, port))
raise PRServiceConfigError