diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-06-07 18:13:04 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-06-14 12:52:57 +0100 |
commit | 5ebd9bfff19a73ace09360f74b6171fe1a6a8f2e (patch) | |
tree | 5416dc5a322553e93314be7291c0b5a6daaaa669 /bitbake/lib/prserv | |
parent | efb877bcdb9584707efab4cee564afecb340e480 (diff) | |
download | poky-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.py | 11 |
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(): | |||
207 | def importone(self, version, pkgarch, checksum, value): | 207 | def importone(self, version, pkgarch, checksum, value): |
208 | return self.connection.importone(version, pkgarch, checksum, value) | 208 | return self.connection.importone(version, pkgarch, checksum, value) |
209 | 209 | ||
210 | def getinfo(self): | ||
211 | return self.host, self.port | ||
212 | |||
210 | def start_daemon(dbfile, host, port, logfile): | 213 | def start_daemon(dbfile, host, port, logfile): |
211 | pidfile = PIDPREFIX % (host, port) | 214 | pidfile = PIDPREFIX % (host, port) |
212 | try: | 215 | try: |
@@ -271,7 +274,7 @@ def auto_start(d): | |||
271 | 274 | ||
272 | host_params = filter(None, (d.getVar('PRSERV_HOST', True) or '').split(':')) | 275 | host_params = filter(None, (d.getVar('PRSERV_HOST', True) or '').split(':')) |
273 | if not host_params: | 276 | if not host_params: |
274 | return True | 277 | return None |
275 | 278 | ||
276 | if len(host_params) != 2: | 279 | if len(host_params) != 2: |
277 | logger.critical('\n'.join(['PRSERV_HOST: incorrect format', | 280 | logger.critical('\n'.join(['PRSERV_HOST: incorrect format', |
@@ -296,7 +299,11 @@ def auto_start(d): | |||
296 | port = int(host_params[1]) | 299 | port = int(host_params[1]) |
297 | 300 | ||
298 | try: | 301 | try: |
299 | return PRServerConnection(host,port).ping() | 302 | connection = PRServerConnection(host,port) |
303 | connection.ping() | ||
304 | realhost, realport = connection.getinfo() | ||
305 | return str(realhost) + ":" + str(realport) | ||
306 | |||
300 | except Exception: | 307 | except Exception: |
301 | logger.critical("PRservice %s:%d not available" % (host, port)) | 308 | logger.critical("PRservice %s:%d not available" % (host, port)) |
302 | raise PRServiceConfigError | 309 | raise PRServiceConfigError |