summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-12-31 18:42:14 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-06 15:27:34 +0000
commit4e0de6eca23488dc6f334ef28453b46c046888af (patch)
treeef36ab255d51578e616c6e8178ae1422bee89020 /bitbake
parent01419d5565a5e3762ec4a2a382f2099683615e52 (diff)
downloadpoky-4e0de6eca23488dc6f334ef28453b46c046888af.tar.gz
bitbake: uievent: add error to registerEventHandler return
Current code throws Exception("Could not register UI event handler") if event handler can't be registered. The real reason of this is that cooker is in busy state. Error message lacks information about this. Added error message to the return value of registerEventHandler. Included returned error message into the log message and exception text. (Bitbake rev: 07de1ca7d57dcd0cc37406feae2949da12a3fa7a) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/server/xmlrpc.py4
-rw-r--r--bitbake/lib/bb/ui/uievent.py8
2 files changed, 7 insertions, 5 deletions
diff --git a/bitbake/lib/bb/server/xmlrpc.py b/bitbake/lib/bb/server/xmlrpc.py
index b7647c198f..17eb28b7d4 100644
--- a/bitbake/lib/bb/server/xmlrpc.py
+++ b/bitbake/lib/bb/server/xmlrpc.py
@@ -97,10 +97,10 @@ class BitBakeServerCommands():
97 97
98 # we don't allow connections if the cooker is running 98 # we don't allow connections if the cooker is running
99 if (self.cooker.state in [bb.cooker.state.parsing, bb.cooker.state.running]): 99 if (self.cooker.state in [bb.cooker.state.parsing, bb.cooker.state.running]):
100 return None 100 return None, "Cooker is busy: %s" % bb.cooker.state.get_name(self.cooker.state)
101 101
102 self.event_handle = bb.event.register_UIHhandler(s, True) 102 self.event_handle = bb.event.register_UIHhandler(s, True)
103 return self.event_handle 103 return self.event_handle, 'OK'
104 104
105 def unregisterEventHandler(self, handlerNum): 105 def unregisterEventHandler(self, handlerNum):
106 """ 106 """
diff --git a/bitbake/lib/bb/ui/uievent.py b/bitbake/lib/bb/ui/uievent.py
index 7fc50c759a..80686a65be 100644
--- a/bitbake/lib/bb/ui/uievent.py
+++ b/bitbake/lib/bb/ui/uievent.py
@@ -52,19 +52,21 @@ class BBUIEventQueue:
52 # giving up 52 # giving up
53 53
54 while self.EventHandler == None and count_tries < 5: 54 while self.EventHandler == None and count_tries < 5:
55 self.EventHandle = self.BBServer.registerEventHandler(self.host, self.port) 55 self.EventHandle, error = self.BBServer.registerEventHandler(self.host, self.port)
56 56
57 if (self.EventHandle != None): 57 if (self.EventHandle != None):
58 break 58 break
59 59
60 bb.warn("Could not register UI event handler %s:%d, retry" % (self.host, self.port)) 60 errmsg = "Could not register UI event handler. Error: %s, " \
61 "host %s, port %d" % (error, self.host, self.port)
62 bb.warn("%s, retry" % errmsg)
61 count_tries += 1 63 count_tries += 1
62 import time 64 import time
63 time.sleep(1) 65 time.sleep(1)
64 66
65 67
66 if self.EventHandle == None: 68 if self.EventHandle == None:
67 raise Exception("Could not register UI event handler") 69 raise Exception(errmsg)
68 70
69 self.server = server 71 self.server = server
70 72