Openembedded Bitbake Development
 help / color / mirror / Atom feed
* [PATCH 1/3] prserv: use only PRSERV_HOST
@ 2013-01-23 14:54 Constantin Musca
  2013-01-25 13:47 ` Martin Jansa
  0 siblings, 1 reply; 2+ messages in thread
From: Constantin Musca @ 2013-01-23 14:54 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Constantin Musca

- remove PRSERV_PORT variable
- use 'hostname:port' as PRSERV_HOST format
- use 'localhost:0' for enabling the local PRServer

[YOCTO #3744]

Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
---
 bitbake/lib/prserv/serv.py | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/bitbake/lib/prserv/serv.py b/bitbake/lib/prserv/serv.py
index 5567c6f..d8bdf31 100644
--- a/bitbake/lib/prserv/serv.py
+++ b/bitbake/lib/prserv/serv.py
@@ -268,10 +268,17 @@ def is_local_special(host, port):
 
 def auto_start(d):
     global singleton
-    if (not d.getVar('PRSERV_HOST', True)) or (not d.getVar('PRSERV_PORT', True)):
+
+    host_params = filter(None, (d.getVar('PRSERV_HOST', True) or '').split(':'))
+    if not host_params:
+        return True
+
+    if len(host_params) != 2:
+        logger.critical('\n'.join(['PRSERV_HOST: incorrect format',
+                'Usage: PRSERV_HOST = "<hostname>:<port>"']))
         return True
 
-    if is_local_special(d.getVar('PRSERV_HOST', True), int(d.getVar('PRSERV_PORT', True))) and not singleton:
+    if is_local_special(host_params[0], int(host_params[1])) and not singleton:
         import bb.utils
         cachedir = (d.getVar("PERSISTENT_DIR", True) or d.getVar("CACHE", True))
         if not cachedir:
@@ -285,8 +292,8 @@ def auto_start(d):
     if singleton:
         host, port = singleton.getinfo()
     else:
-        host = d.getVar('PRSERV_HOST', True)
-        port = int(d.getVar('PRSERV_PORT', True))
+        host = host_params[0]
+        port = int(host_params[1])
 
     try:
         return PRServerConnection(host,port).ping()
-- 
1.7.11.7




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-25 14:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-23 14:54 [PATCH 1/3] prserv: use only PRSERV_HOST Constantin Musca
2013-01-25 13:47 ` Martin Jansa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox