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 | |
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')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 1 | ||||
-rw-r--r-- | bitbake/lib/prserv/serv.py | 11 |
3 files changed, 11 insertions, 3 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 77273dcb29..f375a6f581 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -1177,7 +1177,7 @@ class BBCooker: | |||
1177 | # necessary from the data store. | 1177 | # necessary from the data store. |
1178 | #bb.utils.empty_environment() | 1178 | #bb.utils.empty_environment() |
1179 | try: | 1179 | try: |
1180 | prserv.serv.auto_start(self.data) | 1180 | self.prhost = prserv.serv.auto_start(self.data) |
1181 | except prserv.serv.PRServiceConfigError: | 1181 | except prserv.serv.PRServiceConfigError: |
1182 | bb.event.fire(CookerExit(), self.event_data) | 1182 | bb.event.fire(CookerExit(), self.event_data) |
1183 | return | 1183 | return |
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 577f04a6c5..bd42538688 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -831,6 +831,7 @@ class RunQueue: | |||
831 | "logdefaultverbose" : bb.msg.loggerDefaultVerbose, | 831 | "logdefaultverbose" : bb.msg.loggerDefaultVerbose, |
832 | "logdefaultverboselogs" : bb.msg.loggerVerboseLogs, | 832 | "logdefaultverboselogs" : bb.msg.loggerVerboseLogs, |
833 | "logdefaultdomain" : bb.msg.loggerDefaultDomains, | 833 | "logdefaultdomain" : bb.msg.loggerDefaultDomains, |
834 | "prhost" : self.cooker.prhost, | ||
834 | } | 835 | } |
835 | 836 | ||
836 | worker.stdin.write("<cookerconfig>" + pickle.dumps(self.cooker.configuration) + "</cookerconfig>") | 837 | worker.stdin.write("<cookerconfig>" + pickle.dumps(self.cooker.configuration) + "</cookerconfig>") |
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 |