summaryrefslogtreecommitdiff
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorConstantin Musca <constantinx.musca@intel.com>2013-01-23 16:54:28 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-01-25 12:35:47 +0000
commite00f49de8b1f79c3e07b887d257bd75a46052fa0 (patch)
treeb9bad731f4747a7f6b2472567c08dd8a75d9c210 /meta/lib/oe
parentd8c0ce5a4a27c8aa1d07fc15d6e000af725a51e6 (diff)
downloadopenembedded-core-e00f49de8b1f79c3e07b887d257bd75a46052fa0.tar.gz
openembedded-core-e00f49de8b1f79c3e07b887d257bd75a46052fa0.tar.bz2
openembedded-core-e00f49de8b1f79c3e07b887d257bd75a46052fa0.zip
prserv: change PRSERV_HOST semantics
- remove PRSERV_PORT variable - use 'hostname:port' as PRSERV_HOST format - remove USE_PR_SERV variable - one can activate PRS by setting PRSERV_HOST [YOCTO #3744] Signed-off-by: Constantin Musca <constantinx.musca@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/prservice.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/meta/lib/oe/prservice.py b/meta/lib/oe/prservice.py
index c3fb76a338..57fb39a371 100644
--- a/meta/lib/oe/prservice.py
+++ b/meta/lib/oe/prservice.py
@@ -1,11 +1,10 @@
def prserv_make_conn(d, check = False):
import prserv.serv
- host = d.getVar("PRSERV_HOST",True)
- port = d.getVar("PRSERV_PORT",True)
+ host_params = filter(None, (d.getVar("PRSERV_HOST", True) or '').split(':'))
try:
conn = None
- conn = prserv.serv.PRServerConnection(host,int(port))
+ conn = prserv.serv.PRServerConnection(host_params[0], int(host_params[1]))
if check:
if not conn.ping():
raise Exception('service not available')
@@ -16,7 +15,7 @@ def prserv_make_conn(d, check = False):
return conn
def prserv_dump_db(d):
- if d.getVar('USE_PR_SERV', True) != "1":
+ if not d.getVar('PRSERV_HOST', True):
bb.error("Not using network based PR service")
return None
@@ -35,7 +34,7 @@ def prserv_dump_db(d):
return conn.export(opt_version, opt_pkgarch, opt_checksum, opt_col)
def prserv_import_db(d, filter_version=None, filter_pkgarch=None, filter_checksum=None):
- if d.getVar('USE_PR_SERV', True) != "1":
+ if not d.getVar('PRSERV_HOST', True):
bb.error("Not using network based PR service")
return None
@@ -115,14 +114,13 @@ def prserv_export_tofile(d, metainfo, datainfo, lockdown, nomax=False):
bb.utils.unlockfile(lf)
def prserv_check_avail(d):
- host = d.getVar("PRSERV_HOST",True)
- port = d.getVar("PRSERV_PORT",True)
+ host_params = filter(None, (d.getVar("PRSERV_HOST", True) or '').split(':'))
try:
- if not host:
+ if len(host_params) != 2:
raise TypeError
else:
- port = int(port)
+ int(host_params[1])
except TypeError:
- bb.fatal("Undefined or incorrect values of PRSERV_HOST or PRSERV_PORT")
+ bb.fatal('Undefined/incorrect PRSERV_HOST value. Format: "host:port"')
else:
prserv_make_conn(d, True)