diff options
Diffstat (limited to 'bitbake/lib/prserv')
-rw-r--r-- | bitbake/lib/prserv/serv.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/bitbake/lib/prserv/serv.py b/bitbake/lib/prserv/serv.py index 17ae40967c..68db3d3ec0 100644 --- a/bitbake/lib/prserv/serv.py +++ b/bitbake/lib/prserv/serv.py | |||
@@ -129,6 +129,8 @@ class PRServSingleton(object): | |||
129 | self.prserv.start_tcp_server(self.host, self.port) | 129 | self.prserv.start_tcp_server(self.host, self.port) |
130 | self.process = self.prserv.serve_as_process() | 130 | self.process = self.prserv.serve_as_process() |
131 | 131 | ||
132 | if not self.prserv.address: | ||
133 | raise PRServiceConfigError | ||
132 | if not self.port: | 134 | if not self.port: |
133 | self.port = int(self.prserv.address.rsplit(':', 1)[1]) | 135 | self.port = int(self.prserv.address.rsplit(':', 1)[1]) |
134 | 136 | ||
@@ -276,7 +278,7 @@ def is_running(pid): | |||
276 | return True | 278 | return True |
277 | 279 | ||
278 | def is_local_special(host, port): | 280 | def is_local_special(host, port): |
279 | if host.strip().lower() == 'localhost' and not port: | 281 | if (host == 'localhost' or host == '127.0.0.1') and not port: |
280 | return True | 282 | return True |
281 | else: | 283 | else: |
282 | return False | 284 | return False |
@@ -300,7 +302,9 @@ def auto_start(d): | |||
300 | 'Usage: PRSERV_HOST = "<hostname>:<port>"'])) | 302 | 'Usage: PRSERV_HOST = "<hostname>:<port>"'])) |
301 | raise PRServiceConfigError | 303 | raise PRServiceConfigError |
302 | 304 | ||
303 | if is_local_special(host_params[0], int(host_params[1])): | 305 | host = host_params[0].strip().lower() |
306 | port = int(host_params[1]) | ||
307 | if is_local_special(host, port): | ||
304 | import bb.utils | 308 | import bb.utils |
305 | cachedir = (d.getVar("PERSISTENT_DIR") or d.getVar("CACHE")) | 309 | cachedir = (d.getVar("PERSISTENT_DIR") or d.getVar("CACHE")) |
306 | if not cachedir: | 310 | if not cachedir: |
@@ -314,14 +318,11 @@ def auto_start(d): | |||
314 | auto_shutdown() | 318 | auto_shutdown() |
315 | if not singleton: | 319 | if not singleton: |
316 | bb.utils.mkdirhier(cachedir) | 320 | bb.utils.mkdirhier(cachedir) |
317 | singleton = PRServSingleton(os.path.abspath(dbfile), os.path.abspath(logfile), "localhost", 0) | 321 | singleton = PRServSingleton(os.path.abspath(dbfile), os.path.abspath(logfile), host, port) |
318 | singleton.start() | 322 | singleton.start() |
319 | if singleton: | 323 | if singleton: |
320 | host = singleton.host | 324 | host = singleton.host |
321 | port = singleton.port | 325 | port = singleton.port |
322 | else: | ||
323 | host = host_params[0] | ||
324 | port = int(host_params[1]) | ||
325 | 326 | ||
326 | try: | 327 | try: |
327 | ping(host, port) | 328 | ping(host, port) |