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-12 17:48:52 +0100 |
commit | c761751e259bb8e940552a28794b45887b5a72d9 (patch) | |
tree | 0504eb972355270d1ad0b9074d61bab8c99f9f7b /lib/prserv/serv.py | |
parent | 860ec42b220b7ed3f3bbe52c3546bba66644eac8 (diff) | |
download | bitbake-c761751e259bb8e940552a28794b45887b5a72d9.tar.gz |
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.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/prserv/serv.py')
-rw-r--r-- | lib/prserv/serv.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/prserv/serv.py b/lib/prserv/serv.py index d7ab9ee0d..7f9331d13 100644 --- a/lib/prserv/serv.py +++ b/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 |